# Path: lib/layer.py
# def layer(self, node):
#     for l in self.node_to_layer:
#         if int(node) < l[0]:
#             return l[1]
#     print "Unable to find the right layer for node {0}".format(node)
#     print self.node_to_layer
# 
# Path: lib/bikestations.py
# def get_text(node):
# def get_int(node):
# def get_float(node):
#     def __init__(self, url, name, metadata):
#     def import_data(self):
#     def update_from_db(self):
#     def to_string(self):
# class BikeStationImporter():
# 
# Path: web/shorturl.py
# class shortURL:
#     def __init__(self,metadata):
#     def addRouteToDatabase(self,lonMap,latMap,zoom,lonStart,latStart,lonDest,latDest,addressStart,addressDest, time):
#     def getDataFromHash(self,value):


from lib.core import mumoro
from lib.core.mumoro import Bike, Car, Foot, PublicTransport, cost, co2, dist, elevation, line_change, mode_change, Costs
from lib import layer
from lib import bikestations as bikestations
from web import shorturl
from sqlalchemy import *
from sqlalchemy.orm import mapper, sessionmaker, clear_mappers
from cherrypy import request
from genshi.template import TemplateLoader
import cherrypy
import sys
import simplejson as json
import os
import time
import urllib
import httplib
import hashlib
import datetime
    if not layer1 or not layer2 or not cost:
        raise NameError('One or more paramaters are empty')
    nearest_nodes_connection_array.append( { 'layer1':layer1, 'layer2':layer2, 'cost':cost, 'cost2':cost2 } )

class Mumoro:
    def __init__(self,db_string,config_file,admin_email,web_url):
        if not admin_email:
            raise NameError('Administrator email is empty')
        self.admin_email = admin_email
        if not web_url:
            raise NameError('Website URL is empty')
        self.web_url = web_url
        if not layer_array:
                raise NameError('Can not create multimodal graph beceause there are no layers')
        layers = []
        for i in layer_array:
            layers.append( i['layer'] )
        for i in range( len( layer_array ) ):
            for j in range( len( layer_array ) ):
                if i != j:
                    if layer_array[i]['name'] == layer_array[j]['name']:
                        raise NameError('Layers can not have the same name')
        if len( paths_array ) == 0:
            print 'Warning: there are no defined paths !'
        self.engine = create_engine(db_string)
        self.metadata = MetaData(bind = self.engine)
        Session = sessionmaker(bind=self.engine)
        self.session = Session()
        self.bike_stations = []
        for i in bike_stations_array:

# Path: lib/layer.py
# def layer(self, node):
#     for l in self.node_to_layer:
#         if int(node) < l[0]:
#             return l[1]
#     print "Unable to find the right layer for node {0}".format(node)
#     print self.node_to_layer
# 
# Path: lib/bikestations.py
# def get_text(node):
# def get_int(node):
# def get_float(node):
#     def __init__(self, url, name, metadata):
#     def import_data(self):
#     def update_from_db(self):
#     def to_string(self):
# class BikeStationImporter():
# 
# Path: web/shorturl.py
# class shortURL:
#     def __init__(self,metadata):
#     def addRouteToDatabase(self,lonMap,latMap,zoom,lonStart,latStart,lonDest,latDest,addressStart,addressDest, time):
#     def getDataFromHash(self,value):


# Path: server.py
from lib.core import mumoro
from lib.core.mumoro import Bike, Car, Foot, PublicTransport, cost, co2, dist, elevation, line_change, mode_change, Costs
from lib import layer
from lib import bikestations as bikestations
from web import shorturl
from sqlalchemy import *
from sqlalchemy.orm import mapper, sessionmaker, clear_mappers
from cherrypy import request
from genshi.template import TemplateLoader
import cherrypy
import sys
import simplejson as json
import os
import time
import urllib
import httplib
import hashlib
import datetime

    if not layer1 or not layer2 or not cost:
        raise NameError('One or more paramaters are empty')
    nearest_nodes_connection_array.append( { 'layer1':layer1, 'layer2':layer2, 'cost':cost, 'cost2':cost2 } )

class Mumoro:
    def __init__(self,db_string,config_file,admin_email,web_url):
        if not admin_email:
            raise NameError('Administrator email is empty')
        self.admin_email = admin_email
        if not web_url:
            raise NameError('Website URL is empty')
        self.web_url = web_url
        if not layer_array:
                raise NameError('Can not create multimodal graph beceause there are no layers')
        layers = []
        for i in layer_array:
            layers.append( i['layer'] )
        for i in range( len( layer_array ) ):
            for j in range( len( layer_array ) ):
                if i != j:
                    if layer_array[i]['name'] == layer_array[j]['name']:
                        raise NameError('Layers can not have the same name')
        if len( paths_array ) == 0:
            print 'Warning: there are no defined paths !'
        self.engine = create_engine(db_string)
        self.metadata = MetaData(bind = self.engine)
        Session = sessionmaker(bind=self.engine)
        self.session = Session()
        self.bike_stations = []
        for i in bike_stations_array:

            self.bike_stations.append( bikestations.BikeStationImporter(i['url_api'],i['table'],self.metadata) )