Beispiel #1
0
def main(argv=sys.argv):
    if len(argv) != 2:
        usage(argv)
    config_uri = argv[1]
    setup_logging(config_uri)
    settings = get_appsettings(config_uri)
    engine = create_engine('pyshop', settings, scoped=False)
    populate(engine)
    dispose_engine('pyshop')
Beispiel #2
0
def main(argv=sys.argv):
    if len(argv) != 2:
        usage(argv)
    config_uri = argv[1]
    setup_logging(config_uri)
    settings = get_appsettings(config_uri)
    engine = create_engine('pyshop', settings, scoped=False)
    populate(engine)
    dispose_engine('pyshop')
Beispiel #3
0
def main(argv=sys.argv):
    if len(argv) < 2:
        usage(argv)
        return

    if len(argv) == 2:
        interactive = True
        config_uri = argv[1]
    else:

        if argv[1] != '-y':
            usage(argv)
            return
        interactive = False
        config_uri = argv[2]

    setup_logging(config_uri)
    settings = get_appsettings(config_uri)
    engine = create_engine('pyshop', settings, scoped=False)
    populate(engine, interactive)
    dispose_engine('pyshop')
Beispiel #4
0
def main(argv=sys.argv):
    if len(argv) != 3:
        usage(argv)
    version = argv[2]
    version = version.replace('.', '_')
    try:
        migration = import_module('pyshop.bin.migration.migr_%s' % version)
    except ImportError:
        print('No migration script for that version found')
        sys.exit()

    config_uri = argv[1]
    setup_logging(config_uri)
    settings = get_appsettings(config_uri)
    engine = create_engine('pyshop', settings, scoped=False)

    config = Configurator(settings=settings)
    config.end()

    migration.main(argv[:-1])
    dispose_engine('pyshop')
Beispiel #5
0
def main(argv=sys.argv):
    if len(argv) < 2:
        usage(argv)
        return

    if len(argv) == 2:
        interactive = True
        config_uri = argv[1]
    else:

        if argv[1] != '-y':
            usage(argv)
            return
        interactive = False
        config_uri = argv[2]
        
        
    setup_logging(config_uri)
    settings = get_appsettings(config_uri)
    engine = create_engine('pyshop', settings, scoped=False)
    populate(engine, interactive)
    dispose_engine('pyshop')
Beispiel #6
0
def main(argv=sys.argv):
    if len(argv) != 2:
        usage(argv)
    config_uri = argv[1]
    settings = get_appsettings(config_uri)
    engine = create_engine('pyshop', settings, scoped=False)

    config = Configurator(settings=settings)
    config.end()

    from pyshop.models import (User, Group, Classifier, Package, Release,
                               ReleaseFile)

    session = DBSession()
    try:
        from IPython import embed
        from IPython.config.loader import Config
        cfg = Config()
        cfg.InteractiveShellEmbed.confirm_exit = False
        embed(config=cfg, banner1="Welcome to PyShop shell.")
    except ImportError:
        import code
        code.interact("pyshop shell", local=locals())
Beispiel #7
0
def main(argv=sys.argv):
    if len(argv) != 2:
        usage(argv)
    config_uri = argv[1]
    settings = get_appsettings(config_uri)
    engine = create_engine("pyshop", settings, scoped=False)

    config = Configurator(settings=settings)
    config.end()

    from pyshop.models import User, Group, Classifier, Package, Release, ReleaseFile

    session = DBSession()
    try:
        from IPython import embed
        from IPython.config.loader import Config

        cfg = Config()
        cfg.InteractiveShellEmbed.confirm_exit = False
        embed(config=cfg, banner1="Welcome to PyShop shell.")
    except ImportError:
        import code

        code.interact("pyshop shell", local=locals())