Esempio n. 1
0
def build_content_generation_tasks(conf, app):
    """
    :param Configuration conf: The current build configuration object.

    :param BuildApp app: A :class:`~giza.core.app.BuildApp()` object.

    Add tasks to the ``app`` for all tasks that modify the content in
    ``build/<branch>/source`` directory.
    """
    app.randomize = True

    with Timer("adding content tasks"):
        for content, func in conf.system.content.task_generators:
            t = app.add('task')
            t.job = func
            t.args = [conf]
            t.target = True

        results = app.run()

        for content_generator_tasks in results:
            app.extend_queue(content_generator_tasks)

    robots_txt_tasks(conf, app)
    intersphinx_tasks(conf, app)
    includes_tasks(conf, app)
    table_tasks(conf, app)
    hash_tasks(conf, app)
    api_tasks(conf, app)
    redirect_tasks(conf, app)
    image_tasks(conf, app)
Esempio n. 2
0
def redirects(args):
    c = fetch_config(args)

    if args.dry_run is True:
        print(''.join(make_redirect(c)))
    else:
        with BuildApp.context(c) as app:
            redirect_tasks(c, app)
Esempio n. 3
0
def redirects(args):
    c = fetch_config(args)

    if args.dry_run is True:
        print("".join(make_redirect(c)))
    else:
        app = BuildApp(c)

        redirect_tasks(c, app)
        app.run()
Esempio n. 4
0
def redirects(args):
    c = fetch_config(args)

    if args.dry_run is True:
        print(''.join(make_redirect(c)))
    else:
        with BuildApp.new(pool_type=c.runstate.runner,
                          pool_size=c.runstate.pool_size,
                          force=c.runstate.force).context() as app:
            app.extend_queue(redirect_tasks(c))
Esempio n. 5
0
def redirects(args):
    c = fetch_config(args)

    if args.dry_run is True:
        print(''.join(make_redirect(c)))
    else:
        with BuildApp.new(pool_type=c.runstate.runner,
                          pool_size=c.runstate.pool_size,
                          force=c.runstate.force).context() as app:
            app.extend_queue(redirect_tasks(c))
Esempio n. 6
0
def build_content_generation_tasks(conf, app):
    redirect_tasks(conf, app)
    steps_tasks(conf, app.add('app'))
    toc_tasks(conf, app)
    example_tasks(conf, app)
Esempio n. 7
0
def build_content_generation_tasks(conf, app):
    hash_tasks(conf, app)
    redirect_tasks(conf, app)
    steps_tasks(conf, app.add('app'))
    toc_tasks(conf, app)
    example_tasks(conf, app)