Пример #1
0
LOGIN_MANAGER = LoginManager()
LOGIN_MANAGER.init_app(APP)

LANGUAGES = (('en', 'English'), ('fr', 'Français'), ('de', 'German'),
             ('de_DE', 'German (Germany)'), ('nl_NL',
                                             'Nederlands (Nederland)'),
             ('es_BO', 'Español (Bolivia)'), ('hr_HR', 'Croatian (Croatia)'))

# Should GHC Runner be run within GHC webapp?
if CONFIG['GHC_RUNNER_IN_WEBAPP'] is True:
    LOGGER.info('Running GHC Scheduler in WebApp')
    from scheduler import start_schedule

    # Start scheduler
    start_schedule()
else:
    LOGGER.info('NOT Running GHC Scheduler in WebApp')


# commit or rollback shorthand
def db_commit():
    err = None
    try:
        DB.session.commit()
    except Exception as err:
        DB.session.rollback()
    # finally:
    #     DB.session.close()
    return err
Пример #2
0
    ('en', 'English'),
    ('fr', 'Français'),
    ('de', 'German'),
    ('de_DE', 'German (Germany)'),
    ('nl_NL', 'Nederlands (Nederland)'),
    ('es_BO', 'Español (Bolivia)'),
    ('hr_HR', 'Croatian (Croatia)')
)

# Should GHC Runner be run within GHC webapp?
if CONFIG['GHC_RUNNER_IN_WEBAPP'] is True:
    LOGGER.info('Running GHC Scheduler in WebApp')
    from scheduler import start_schedule

    # Start scheduler
    start_schedule()
else:
    LOGGER.info('NOT Running GHC Scheduler in WebApp')


# commit or rollback shorthand
def db_commit():
    err = None
    try:
        DB.session.commit()
    except Exception as err:
        DB.session.rollback()
    # finally:
    #     DB.session.close()
    return err