def sphinx_build(targets, conf, sconf, finalize_fun): if len(targets) == 0: targets.append('html') sconf = render_sphinx_config(sconf) target_jobs = [] sync = StateAttributeDict() for target in targets: if target in sconf: lsconf = compute_sphinx_config(target, sconf, conf) lconf = edition_setup(lsconf, conf) lconf = language_setup(lsconf, lconf) target_jobs.append({ 'job': build_worker, 'args': [ target, lsconf, lconf, sync, finalize_fun], 'description': "sphinx build worker for {0}".format(target) }) else: logger.warning('not building sphinx target {0} without configuration.'.format(target)) # a batch of prereq jobs go here. primer_migrate_pages(conf) build_process_prerequsites(sync, conf) res = runner(target_jobs, parallel='threads') output_sphinx_stream('\n'.join([r[1] if isinstance(r, tuple) else r for r in res if r is not None]), conf) logger.info('build {0} sphinx targets'.format(len(res)))
def conf(*modifications): "Returns the build configuration object for visual introspection. Optionally specify 'edition' argument." conf = lazy_conf(None) if modifications: if isinstance(modifications, tuple) and len(modifications) <= 2: pass else: modifications = [modifications] for mod in modifications: if len(mod) == 2: sconf = AttributeDict({'language': mod}) conf = language_setup(sconf, conf) else: conf = edition_setup(mod, conf) puts(json.dumps(conf, indent=3))
def sphinx_build(targets, conf, sconf, finalize_fun): if len(targets) == 0: targets.append('html') sconf = render_sphinx_config(sconf) target_jobs = [] sync = StateAttributeDict() for target in targets: if target in sconf: lsconf = compute_sphinx_config(target, sconf, conf) lconf = edition_setup(lsconf, conf) lconf = language_setup(lsconf, lconf) target_jobs.append({ 'job': build_worker, 'args': [target, lsconf, lconf, sync, finalize_fun], 'description': "sphinx build worker for {0}".format(target) }) else: logger.warning( 'not building sphinx target {0} without configuration.'.format( target)) # a batch of prereq jobs go here. primer_migrate_pages(conf) build_process_prerequsites(sync, conf) res = runner(target_jobs, parallel='threads') output_sphinx_stream( '\n'.join([ r[1] if isinstance(r, tuple) else r for r in res if r is not None ]), conf) logger.info('build {0} sphinx targets'.format(len(res)))