コード例 #1
0
ファイル: slides.py プロジェクト: i80and/docs-tools
def slide_tasks(sconf, conf):
    return [giza.libgiza.task.Task(job=slides_tarball,
                                   target=[get_tarball_name('slides', conf),
                                           get_tarball_name('link-slides', conf)],
                                   args=(sconf.name, sconf.build_output, conf),
                                   description="creating tarball for slides"),
            giza.libgiza.task.Task(job=slides_output,
                                   args=[conf],
                                   description='migrating slide output to production')]
コード例 #2
0
ファイル: slides.py プロジェクト: rawfalafel/docs-tools
def slide_tasks(sconf, conf, app):
    task = app.add("task")
    task.job = slides_tarball
    task.target = [get_tarball_name("slides", conf), get_tarball_name("link-slides", conf)]
    task.args = [sconf.name, conf]
    task.description = "creating tarball for slides"

    task = app.add("task")
    task.job = slides_output
    task.args = [conf]
    task.description = "migrating slide output to production"
コード例 #3
0
ファイル: slides.py プロジェクト: willingc/docs-tools
def slide_tasks(sconf, conf):
    return [
        libgiza.task.Task(job=slides_tarball,
                          target=[
                              get_tarball_name('slides', conf),
                              get_tarball_name('link-slides', conf)
                          ],
                          args=(sconf.name, sconf.build_output, conf),
                          description="creating tarball for slides"),
        libgiza.task.Task(job=slides_output,
                          args=[conf],
                          description='migrating slide output to production')
    ]
コード例 #4
0
ファイル: slides.py プロジェクト: banlyst/docs-tools
def slide_tasks(sconf, conf, app):
    task = app.add('task')
    task.job = slides_tarball
    task.target = [
        get_tarball_name('slides', conf),
        get_tarball_name('link-slides', conf)
    ]
    task.args = [sconf.name, conf]
    task.description = "creating tarball for slides"

    task = app.add('task')
    task.job = slides_output
    task.args = [conf]
    task.description = 'migrating slide output to production'
コード例 #5
0
ファイル: sphinx.py プロジェクト: Yingminzhou/docs-tools
def finalize_sphinx_build(sconf, conf, app):
    target = sconf.builder
    logger.info('starting to finalize the Sphinx build {0}'.format(target))

    if target == 'linkcheck':
        app.pool = 'serial'
        task = app.add('task')
        task.job = printer
        task.target = os.path.join(conf.paths.projectroot,
                                   conf.paths.branch_output, builder, 'output.txt')
        task.args = '{0}: See {1}/{0}/output.txt for output.'.format(builder, conf.paths.branch_output)
    elif target == 'dirhtml':
        app.pool = 'thread'
        for job in (finalize_dirhtml_build, error_pages):
            task = app.add('task')
            task.job = job
            task.target = os.path.join(conf.paths.projectroot, conf.paths.public_site_output)
            task.dependency = None
            task.args = [sconf, conf]

        if conf.system.branched is True and conf.git.branches.current == 'master':
            link_task = app.add('task')
            link_task.job = create_manual_symlink
            link_task.target = [ t[0] for t in get_public_links(conf) ]
            link_task.dependency = get_config_paths('integration',conf)
            link_task.dependency.append(os.path.join(conf.paths.projectroot,
                                                     conf.paths.public_site_output))
            link_task.args = [conf]
            link_task.description = "create the 'manual' symlink"
    elif target == 'epub':
        app.pool = 'serial'
        task = app.add('task')
        task.job = finalize_epub_build
        task.args = [target, conf]
        task.description = 'finalizing epub build'
    elif target == 'man':
        app.pool = 'thread'
        manpage_url_tasks(target, conf, app)
        task = app.add('task')
        task.job = man_tarball
        task.target = [get_tarball_name('man', conf),
                       get_tarball_name('link-man', conf)]
        task.args = [target, conf]
        task.description = "creating tarball for manpages"
    elif target == 'html':
        app.pool = 'serial'
        task = app.add('task')
        task.job = html_tarball
        task.target = [get_tarball_name('html', conf),
                       get_tarball_name('link-html', conf)]
        task.args = [sconf.name, conf]
        task.description = "creating tarball for html archive"
    elif target == 'slides':
        app.pool = 'thread'
        slide_tasks(sconf, conf, app)
    elif target == 'json':
        app.pool = 'thread'
        json_output_tasks(conf, app)
    elif target == 'singlehtml':
        app.pool = 'thread'
        finalize_single_html_tasks(target, conf, app)
    elif target == 'latex':
        app.pool = 'thread'
        pdf_tasks(sconf, conf, app)
    elif target == 'gettext':
        app.pool = 'thread'
        gettext_tasks(conf, app)
コード例 #6
0
def finalize_sphinx_build(sconf, conf):
    target = sconf.builder

    tasks = []
    if target == 'html' and not conf.runstate.fast:
        t = Task(job=html_tarball,
                 args=(sconf.name, sconf.build_output, conf),
                 target=[
                     get_tarball_name('html', conf),
                     get_tarball_name('link-html', conf)
                 ],
                 dependency=None,
                 description="creating tarball for html archive")
        tasks.append(t)
    elif target == 'dirhtml' and not conf.runstate.fast:
        for job in (finalize_dirhtml_build, error_pages):
            t = Task(job=job,
                     args=(sconf, conf),
                     target=os.path.join(conf.paths.projectroot,
                                         conf.paths.public_site_output),
                     dependency=None)
            tasks.append(t)

        if conf.system.branched is True and conf.git.branches.current == 'master':
            deps = conf.system.files.get_configs('integration')
            deps.append(
                os.path.join(conf.paths.projectroot,
                             conf.paths.public_site_output))

            t = Task(job=create_manual_symlink,
                     args=[conf],
                     target=[link[0] for link in get_public_links(conf)],
                     dependency=deps,
                     description='create symlinks')
            tasks.append(t)
    elif target == 'epub':
        t = Task(job=finalize_epub_build,
                 args=(target, conf),
                 description='finalizing epub build',
                 dependency=None,
                 target=True)
        tasks.append(t)
    elif target == 'man':
        t = Task(job=man_tarball,
                 args=(sconf.name, sconf.build_output, conf),
                 target=[
                     get_tarball_name('man', conf),
                     get_tarball_name('link-man', conf)
                 ],
                 dependency=None,
                 description="creating tarball for manpages")

        tasks.extend(manpage_url_tasks(target, conf))
        tasks.append(('final', t))
    elif target == 'slides' and not conf.runstate.fast:
        tasks.extend(slide_tasks(sconf, conf))
    elif target == 'json':
        json_tasks, transfer_op = json_output_tasks(conf)
        tasks.extend(json_tasks)
        tasks.append(('final', transfer_op))  # this is less than ideal
    elif target == 'singlehtml':
        tasks.extend(finalize_single_html_tasks(target, conf))
    elif target == 'latex':
        tasks.extend(pdf_tasks(sconf, conf))
    elif target == 'gettext':
        tasks.extend(gettext_tasks(conf))
    elif target == 'linkcheck':
        msg_str = '{0}: See {1}/{0}/output.txt for output.'
        t = Task(job=printer,
                 args=[msg_str.format(target, conf.paths.branch_output)],
                 target=os.path.join(conf.paths.projectroot,
                                     conf.paths.branch_output, target,
                                     'output.txt'),
                 dependency=None)
        tasks.append(t)

    logger.info('adding {0} finalizing tasks for {1} build'.format(
        len(tasks), target))
    return tasks
コード例 #7
0
ファイル: sphinx.py プロジェクト: fviolette/docs-tools
def finalize_sphinx_build(sconf, conf):
    target = sconf.builder

    tasks = []
    if target == 'html' and not conf.runstate.fast:
        t = Task(job=html_tarball,
                 args=(sconf.name, sconf.build_output, conf),
                 target=[get_tarball_name('html', conf),
                         get_tarball_name('link-html', conf)],
                 dependency=None,
                 description="creating tarball for html archive")
        tasks.append(t)
    elif target == 'dirhtml' and not conf.runstate.fast:
        for job in (finalize_dirhtml_build, error_pages):
            t = Task(job=job,
                     args=(sconf, conf),
                     target=os.path.join(conf.paths.projectroot, conf.paths.public_site_output),
                     dependency=None)
            tasks.append(t)

        if conf.system.branched is True and conf.git.branches.current == 'master':
            deps = conf.system.files.get_configs('integration')
            deps.append(os.path.join(conf.paths.projectroot,
                                     conf.paths.public_site_output))

            t = Task(job=create_manual_symlink,
                     args=[conf],
                     target=[link[0] for link in get_public_links(conf)],
                     dependency=deps,
                     description='create symlinks')
            tasks.append(t)
    elif target == 'epub':
        t = Task(job=finalize_epub_build,
                 args=(target, conf),
                 description='finalizing epub build',
                 dependency=None,
                 target=True)
        tasks.append(t)
    elif target == 'man':
        t = Task(job=man_tarball,
                 args=(sconf.name, sconf.build_output, conf),
                 target=[get_tarball_name('man', conf),
                         get_tarball_name('link-man', conf)],
                 dependency=None,
                 description="creating tarball for manpages")

        tasks.extend(manpage_url_tasks(target, conf))
        tasks.append(('final', t))
    elif target == 'slides' and not conf.runstate.fast:
        tasks.extend(slide_tasks(sconf, conf))
    elif target == 'json':
        json_tasks, transfer_op = json_output_tasks(conf)
        tasks.extend(json_tasks)
        tasks.append(('final', transfer_op))  # this is less than ideal
    elif target == 'singlehtml':
        tasks.extend(finalize_single_html_tasks(target, conf))
    elif target == 'latex':
        tasks.extend(pdf_tasks(sconf, conf))
    elif target == 'gettext':
        tasks.extend(gettext_tasks(conf))
    elif target == 'linkcheck':
        msg_str = '{0}: See {1}/{0}/output.txt for output.'
        t = Task(job=printer,
                 args=[msg_str.format(target, conf.paths.branch_output)],
                 target=os.path.join(conf.paths.projectroot,
                                     conf.paths.branch_output, target, 'output.txt'),
                 dependency=None)
        tasks.append(t)

    logger.info('adding {0} finalizing tasks for {1} build'.format(len(tasks), target))
    return tasks
コード例 #8
0
ファイル: sphinx.py プロジェクト: rawfalafel/docs-tools
def finalize_sphinx_build(sconf, conf, app):
    target = sconf.builder
    logger.info('starting to finalize the Sphinx build {0}'.format(target))

    if target == 'linkcheck':
        app.pool = 'serial'
        task = app.add('task')
        task.job = printer
        task.target = os.path.join(conf.paths.projectroot,
                                   conf.paths.branch_output, builder,
                                   'output.txt')
        task.args = '{0}: See {1}/{0}/output.txt for output.'.format(
            builder, conf.paths.branch_output)
    elif target == 'dirhtml':
        app.pool = 'thread'
        for job in (finalize_dirhtml_build, error_pages):
            task = app.add('task')
            task.job = job
            task.target = os.path.join(conf.paths.projectroot,
                                       conf.paths.public_site_output)
            task.dependency = None
            task.args = [sconf, conf]

        if conf.system.branched is True and conf.git.branches.current == 'master':
            link_task = app.add('task')
            link_task.job = create_manual_symlink
            link_task.target = [t[0] for t in get_public_links(conf)]
            link_task.dependency = get_config_paths('integration', conf)
            link_task.dependency.append(
                os.path.join(conf.paths.projectroot,
                             conf.paths.public_site_output))
            link_task.args = [conf]
            link_task.description = "create the 'manual' symlink"
    elif target == 'epub':
        app.pool = 'serial'
        task = app.add('task')
        task.job = finalize_epub_build
        task.args = [target, conf]
        task.description = 'finalizing epub build'
    elif target == 'man':
        app.pool = 'thread'
        manpage_url_tasks(target, conf, app)
        task = app.add('task')
        task.job = man_tarball
        task.target = [
            get_tarball_name('man', conf),
            get_tarball_name('link-man', conf)
        ]
        task.args = [target, conf]
        task.description = "creating tarball for manpages"
    elif target == 'html':
        app.pool = 'serial'
        task = app.add('task')
        task.job = html_tarball
        task.target = [
            get_tarball_name('html', conf),
            get_tarball_name('link-html', conf)
        ]
        task.args = [sconf.name, conf]
        task.description = "creating tarball for html archive"
    elif target == 'slides':
        app.pool = 'thread'
        slide_tasks(sconf, conf, app)
    elif target == 'json':
        app.pool = 'thread'
        json_output_tasks(conf, app)
    elif target == 'singlehtml':
        app.pool = 'thread'
        finalize_single_html_tasks(target, conf, app)
    elif target == 'latex':
        app.pool = 'thread'
        pdf_tasks(sconf, conf, app)
    elif target == 'gettext':
        app.pool = 'thread'
        gettext_tasks(conf, app)
コード例 #9
0
ファイル: sphinx.py プロジェクト: isabella232/docs-tools-1
def finalize_sphinx_build(sconf, conf):
    target = sconf.builder

    tasks = []
    if target == 'html' and not conf.runstate.fast:
        t = Task(job=html_tarball,
                 args=(sconf.name, sconf.build_output, conf),
                 target=[get_tarball_name('html', conf),
                         get_tarball_name('link-html', conf)],
                 dependency=None,
                 description="creating tarball for html archive")
        tasks.append(t)
    elif target == 'dirhtml' and not conf.runstate.fast:
        # We're experiencing some cases were giza seemingly randomly doesn't migrate.
        # Log this to help us figure out what's going on.
        logger.info('Going to migrate {} to {}'.format(
            sconf.fq_build_output,
            os.path.join(conf.paths.projectroot, conf.paths.public_site_output)))

        for job in (finalize_dirhtml_build, error_pages):
            t = Task(job=job,
                     args=(sconf, conf),
                     target=os.path.join(conf.paths.projectroot, conf.paths.public_site_output),
                     dependency=None)
            tasks.append(t)
    elif target == 'epub':
        t = Task(job=finalize_epub_build,
                 args=(target, conf),
                 description='finalizing epub build',
                 dependency=None,
                 target=True)
        tasks.append(t)
    elif target == 'man':
        t = Task(job=man_tarball,
                 args=(sconf.name, sconf.build_output, conf),
                 target=[get_tarball_name('man', conf),
                         get_tarball_name('link-man', conf)],
                 dependency=None,
                 description="creating tarball for manpages")

        tasks.extend(manpage_url_tasks(target, conf))
        tasks.append(('final', t))
    elif target == 'slides' and not conf.runstate.fast:
        tasks.extend(slide_tasks(sconf, conf))
    elif target == 'json':
        json_tasks, transfer_op = json_output_tasks(conf)
        tasks.extend(json_tasks)
        tasks.append(('final', transfer_op))  # this is less than ideal
    elif target == 'singlehtml':
        tasks.extend(finalize_single_html_tasks(target, conf))
    elif target == 'latex':
        tasks.extend(pdf_tasks(sconf, conf))
    elif target == 'gettext':
        tasks.extend(gettext_tasks(conf))
    elif target == 'linkcheck':
        msg_str = '{0}: See {1}/{0}/output.txt for output.'
        t = Task(job=printer,
                 args=[msg_str.format(target, conf.paths.branch_output)],
                 target=os.path.join(conf.paths.projectroot,
                                     conf.paths.branch_output, target, 'output.txt'),
                 dependency=None)
        tasks.append(t)

    logger.debug('adding {0} finalizing tasks for {1} build'.format(len(tasks), target))
    return tasks