Exemple #1
0
def run_standalone():
    """Run OL in standalone mode.
    No separate infobase server is required.
    """
    infogami.config.db_parameters = web.config.db_parameters = config.db_parameters
    config.infobase_server = None
    web.load()

    from infogami.infobase import server
    server._infobase = get_infobase()
    
    if '--create' in sys.argv:
        server._infobase.create('openlibrary.org')
    else:
        infogami.run()
Exemple #2
0
# infogami.config.plugin_path += ['plugins']
# infogami.config.plugins += ['search']


def createsite():
    import web
    from infogami.infobase import dbstore, infobase, config, server

    web.config.db_parameters = infogami.config.db_parameters
    web.config.db_printing = True
    web.ctx.ip = '127.0.0.1'

    server.app.request('/')
    schema = dbstore.Schema()
    store = dbstore.DBStore(schema)
    ib = infobase.Infobase(store, config.secret_key)
    ib.create(infogami.config.site)


if __name__ == "__main__":
    import sys

    if '--schema' in sys.argv:
        from infogami.infobase.dbstore import Schema

        print(Schema().sql())
    elif '--createsite' in sys.argv:
        createsite()
    else:
        infogami.run()
Exemple #3
0
infogami.config.admin_password = "******"

## add additional plugins and plugin path
#infogami.config.plugin_path += ['plugins']
#infogami.config.plugins += ['search']

def createsite():
    import web
    from infogami.infobase import dbstore, infobase, config, server
    web.config.db_parameters = infogami.config.db_parameters
    web.config.db_printing = True
    web.ctx.ip = '127.0.0.1'

    server.app.request('/')
    schema = dbstore.Schema()
    store = dbstore.DBStore(schema)
    ib = infobase.Infobase(store, config.secret_key)
    ib.create(infogami.config.site)

if __name__ == "__main__":
    import sys

    if '--schema' in sys.argv:
        from infogami.infobase.dbstore import Schema
        print Schema().sql()
    elif '--createsite' in sys.argv:
        createsite()
    else:
        infogami.run()

Exemple #4
0
def run_client():
    """Run OpenLibrary as client.
    Requires a separate infobase server to be running.
    """
    assert config.infobase_server is not None, "Please specify ol.config.infobase_server"
    infogami.run()
Exemple #5
0
def run():
    import infogami.infobase.server
    infogami.infobase.server._infobase = get_infobase()
    infogami.run()