# -*- python -*- # env.py: created 2011/01/21. # # Copyright (C) 2008-2010 Networks In Motion, Inc. All rights reserved. # # The information contained herein is confidential and proprietary to # Networks In Motion, Inc., and is considered a trade secret as # defined in section 499C of the California Penal Code. Use of this # information by anyone other than authorized employees of Networks # In Motion is granted only under a written non-disclosure agreement # expressly prescribing the scope and manner of such use. # """ISMS. ENV""" from tesla import envloader envloader.load_configuration(globals(), '/usr/local/home/krozin/sqllite/sqlite.conf')
import os from tesla import envloader #if os.path.exists('/usr/local/nb/nbserver/config/public_transit_feeds.conf'): # envloader.load_configuration(globals(), '/usr/local/nb/nbserver/config/public_transit_feeds.conf') #elif os.path.exists('/usr/local/nb/nbserver/baseconfig/public_transit_feeds.conf'): # envloader.load_configuration(globals(), '/usr/local/nb/nbserver/baseconfig/public_transit_feeds.conf') #else: # envloader.load_configuration(globals(), './public_transit_feeds.conf') envloader.load_configuration(globals(), './public_transit_feeds.conf')
# Degrees of latitude per meter DPM = 8.983345800106980e-006 class MongoDBConfig(object): def __init__(self, filename='./public_transit_feeds.conf'): from tesla import envloader d = envloader.load_configuration(globals(), filename).get('mongodb') object.__setattr__(self,'_selfdict', d) def __getattr__(self, name): for key, value in self._selfdict: if key == name: return self._selfdict[name] return None mongodb_config = envloader.load_configuration(globals(), './public_transit_feeds.conf').get('mongodb') from tesla.envconfig import TeslaConfig class mdbConfig(TeslaConfig): def __init__(self): TeslaConfig.__init__(self, './public_transit_feeds.conf') class PoitsLayerMongoDB(object): def __init__(self, host=None, port=None): if host and port: self.host, self.port = host, port self.connection = Connection(self.host, self.port) else: self.connection = Connection() self.databasename = str(ptenv.mongodb.databasename)
def __init__(self, filename='./public_transit_feeds.conf'): from tesla import envloader d = envloader.load_configuration(globals(), filename).get('mongodb') object.__setattr__(self,'_selfdict', d)