def build(templates=None, schemes=None, base_output_dir=None):
    """Main build function to initiate building process."""
    template_dirs = templates or get_template_dirs()
    scheme_files = get_scheme_files(schemes)
    base_output_dir = base_output_dir or rel_to_cwd('output')

    # raise LookupError if there is not at least one template or scheme
    # to work with
    if not template_dirs or not scheme_files:
        raise LookupError

    # raise PermissionError if user has no write acces for $base_output_dir
    try:
        os.makedirs(base_output_dir)
    except FileExistsError:
        pass

    if not os.access(base_output_dir, os.W_OK):
        raise PermissionError

    templates = [TemplateGroup(path) for path in template_dirs]

    build_from_job_list(scheme_files, templates, base_output_dir)
    print('Finished building process.')
def build ( templates = None , schemes = None , base_output_dir = None ) : template_dirs = templates or get_template_dirs ( ) scheme_files = get_scheme_files ( schemes ) base_output_dir = base_output_dir or rel_to_cwd ( 'output' ) if not template_dirs or not scheme_files : raise LookupError try : os . makedirs ( base_output_dir ) except FileExistsError : pass if not os . access ( base_output_dir , os . W_OK ) : raise PermissionError templates = [ TemplateGroup ( path ) for path in template_dirs ] build_from_job_list ( scheme_files , templates , base_output_dir ) print ( 'Finished building process.' )
Main build function to initiate building process.