Example #1
0
def setup_module(mod):
    utils.setup_conn(mod)
    utils.setup_server(mod)

    mod.site = client.Site(mod.conn, "test")
    mod.s = mod.site.store
    mod.seq = mod.site.seq
Example #2
0
    def add(self, doc):
        #@@ UGLY!
        doc = common.parse_query(doc)
        doc = client.Site(None, None)._process_dict(doc)

        key = doc['key']
        self.docs[key] = client.create_thing(self, key, doc)

        olid = key.split("/")[-1]
        if web.re_compile(r'OL\d+[A-Z]').match(olid):
            self.olids[olid] = key
Example #3
0
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)
Example #4
0
 def create_site(self, name='test'):
     conn = client.connect(type='local')
     return client.Site(conn, 'test')