Esempio n. 1
0
def run():
    """Populates all tables in db with most recent data"""
    with app.app_context():
        args = (config.RECIPIENT, app.config.get('LOGFILE'), __title__)
        exception_handler = swutils.ExceptionHandler(*args).handler
        kwargs = merge([app.config, {'models': models}])
        job = partial(swutils.populate, utils.gen_data, db.engine, **kwargs)
        swutils.run_or_schedule(job, app.config['SW'], exception_handler)
Esempio n. 2
0
def run():
    """Populates all tables in db with most recent data"""
    with app.app_context():
        args = (config.RECIPIENT, app.config.get('LOGFILE'), __title__)
        exception_handler = swutils.ExceptionHandler(*args).handler
        kwargs = merge([app.config, {'models': models}])
        job = partial(swutils.populate, utils.gen_data, db.engine, **kwargs)
        swutils.run_or_schedule(job, app.config['SW'], exception_handler)
Esempio n. 3
0
def run():
    """Populates all tables in db with most recent data"""
    with app.app_context():
        args = (config.RECIPIENT, app.config.get('LOGFILE'), __title__)
        exception_handler = swutils.ExceptionHandler(*args).handler
        extra = {'mixin': BaseMixin, 'get_name': lambda x: 'ym%s' % x}
        kwargs = merge([app.config, extra])
        job = partial(swutils.populate, utils.gen_data, db.engine, **kwargs)
        swutils.run_or_schedule(job, app.config['SW'], exception_handler)
Esempio n. 4
0
def run():
    """Populates all tables in db with most recent data"""
    with app.app_context():
        args = (config.RECIPIENT, app.config.get('LOGFILE'), __title__)
        exception_handler = swutils.ExceptionHandler(*args).handler
        extra = {
            'fetch': utils.fetch,
            'get_name': utils.get_name,
            'normalize': utils.normalize,
            'filterer': utils.filterer,
            'parse': utils.parse}

        kwargs = merge([app.config, extra])
        job = partial(swutils.populate, db.engine, models, **kwargs)
        swutils.run_or_schedule(job, app.config['SW'], exception_handler)
Esempio n. 5
0
def run():
    """Populates all tables in db with most recent data"""
    with app.app_context():
        args = (config.RECIPIENT, app.config.get('LOGFILE'), __title__)
        exception_handler = swutils.ExceptionHandler(*args).handler
        swutils.run_or_schedule(populate, app.config['SW'], exception_handler)