Пример #1
0
def init(url, engine_options=None, create_tables=False):
    """Connect mappings to the database"""
    # Load the appropriate db module
    engine_options = engine_options or {}
    engine = build_engine(url, engine_options)
    result = ModelMapping([install_model], engine=engine)
    # Create tables if needed
    if create_tables:
        metadata.create_all(bind=engine)
        # metadata.engine.commit()
    result.create_tables = create_tables
    # load local galaxy security policy
    return result
Пример #2
0
def init( url, engine_options={}, create_tables=False ):
    """Connect mappings to the database"""
    # Load the appropriate db module
    engine = build_engine( url, engine_options )
    # Connect the metadata to the database.
    metadata.bind = engine
    result = ModelMapping( [ install_model ], engine=engine )
    # Create tables if needed
    if create_tables:
        metadata.create_all()
        # metadata.engine.commit()
    result.create_tables = create_tables
    #load local galaxy security policy
    return result
Пример #3
0
def init(file_path, url, engine_options={}, create_tables=False):
    """Connect mappings to the database"""
    # Create the database engine
    engine = build_engine(url, engine_options)
    # Connect the metadata to the database.
    metadata.bind = engine

    result = ModelMapping([tool_shed.webapp.model], engine=engine)

    if create_tables:
        metadata.create_all()

    result.create_tables = create_tables

    # Load local tool shed security policy
    result.security_agent = CommunityRBACAgent(result)
    result.shed_counter = shed_statistics.ShedCounter(result)
    return result
Пример #4
0
def init(file_path, url, engine_options={}, create_tables=False):
    """Connect mappings to the database"""
    # Create the database engine
    engine = build_engine(url, engine_options)
    # Connect the metadata to the database.
    metadata.bind = engine

    result = ModelMapping([galaxy.webapps.tool_shed.model], engine=engine)

    if create_tables:
        metadata.create_all()

    result.create_tables = create_tables

    # Load local tool shed security policy
    result.security_agent = CommunityRBACAgent(result)
    result.shed_counter = shed_statistics.ShedCounter(result)
    result.hgweb_config_manager = galaxy.webapps.tool_shed.util.hgweb_config.HgWebConfigManager()
    return result