def create_connection(): if config.get('infobase_server'): return client.connect(type='remote', base_url=config.infobase_server) elif config.get('db_parameters'): return client.connect(type='local', **config.db_parameters) else: raise Exception("db_parameters are not specified in the configuration")
def create_connection(): if config.get('infobase_server'): return client.connect(type='remote', base_url=config.infobase_server) elif config.get('db_parameters'): return client.connect(type='local', **config.db_parameters) else: raise Exception( "db_parameters are not specified in the configuration")
def create_site(): from infogami.infobase import client if config.site is None: site = web.ctx.host.split(':')[0] # strip port else: site = config.site web.ctx.conn = client.connect(**config.infobase_parameters) # set auto token in the connection if web.ctx.get('env'): # do this only if web.load is already called auth_token = web.cookies().get(config.login_cookie_name) web.ctx.conn.set_auth_token(auth_token) return client.Site(web.ctx.conn, site)
def create_site(self, name='test'): conn = client.connect(type='local') return client.Site(conn, 'test')
def create_remote_connection(): return client.connect(type='remote', base_url=config.infobase_server)
def create_local_connection(): _update_infobase_config() return client.connect(type='local', **web.config.db_parameters)
def create_connection(self): conn = client.connect(**infogami.config.infobase_parameters) auth_token = web.cookies().get(infogami.config.login_cookie_name) conn.set_auth_token(auth_token) return conn
def __init__(self, host, sitename='openlibrary.org'): self.conn = client.connect(type='remote', base_url=host) self.sitename = sitename
def create_connection(self): if config.infobase_server: return client.connect(type='remote', base_url=config.infobase_server) else: return client.connect(type='local', **config.db_parameters)