示例#1
0
文件: cli.py 项目: ComPath/ComPath
def drop_databases(debug, yes, connection):
    """Drop all databases."""
    set_debug_param(debug)

    if yes or click.confirm(
            'Do you really want to delete the databases for {}?'.format(
                ', '.join(managers))):
        for name, Manager in managers.items():
            m = Manager(connection=connection)
            click.echo('deleting {}'.format(name))
            m.drop_all()
示例#2
0
文件: cli.py 项目: ComPath/ComPath
def populate(debug, connection, delete_first):
    """Populate all registered Bio2BEL pathway packages."""
    set_debug_param(debug)

    for name, Manager in managers.items():
        m = Manager(connection=connection)
        log.info('populating %s at %s', name, m.engine.url)

        if delete_first:
            click.echo('deleting {}'.format(name))
            m.drop_all()
            m.create_all()

        click.echo('populating {}'.format(name))
        m.populate()