def _config_default(self):
     # load application config by default
     if JupyterHub.initialized():
         return JupyterHub.instance().config
     else:
         return Config()
Ejemplo n.º 2
0
from sqlalchemy import pool

# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config

# Interpret the config file for Python logging.
# This line sets up loggers basically.
if 'jupyterhub' in sys.modules:
    from traitlets.config import MultipleInstanceError
    from jupyterhub.app import JupyterHub

    app = None
    if JupyterHub.initialized():
        try:
            app = JupyterHub.instance()
        except MultipleInstanceError:
            # could have been another Application
            pass
    if app is not None:
        alembic_logger = logging.getLogger('alembic')
        alembic_logger.propagate = True
        alembic_logger.parent = app.log
    else:
        fileConfig(config.config_file_name, disable_existing_loggers=False)
else:
    fileConfig(config.config_file_name)

# add your model's MetaData object here for 'autogenerate' support
from jupyterhub import orm
Ejemplo n.º 3
0
from sqlalchemy import pool

# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config

# Interpret the config file for Python logging.
# This line sets up loggers basically.
if 'jupyterhub' in sys.modules:
    from traitlets.config import MultipleInstanceError
    from jupyterhub.app import JupyterHub

    app = None
    if JupyterHub.initialized():
        try:
            app = JupyterHub.instance()
        except MultipleInstanceError:
            # could have been another Application
            pass
    if app is not None:
        alembic_logger = logging.getLogger('alembic')
        alembic_logger.propagate = True
        alembic_logger.parent = app.log
    else:
        fileConfig(config.config_file_name)
else:
    fileConfig(config.config_file_name)

# add your model's MetaData object here for 'autogenerate' support
from jupyterhub import orm