def config(): """ Process config files and commandline params. """ ap = argparse.ArgumentParser(prog='EbookMaker') CommonCode.add_common_options(ap, CONFIG_FILES[1]) add_local_options(ap) options = CommonCode.parse_config_and_args( ap, CONFIG_FILES[0], { 'proxies': None, 'xelatex': 'xelatex', 'mobigen': 'kindlegen', 'groff': 'groff', 'rhyming_dict': None, 'timestamp': datetime.datetime.today().isoformat()[:19], }) builtins.options = options builtins._ = CommonCode.null_translation if '://' not in options.url: options.url = os.path.abspath(options.url)
def config(): """ Process config files and commandline params. """ ap = argparse.ArgumentParser(prog='EbookMaker') CommonCode.add_common_options(ap, CONFIG_FILES[1]) add_local_options(ap) CommonCode.set_arg_defaults(ap, CONFIG_FILES[1]) global options options.update( vars( CommonCode.parse_config_and_args( ap, CONFIG_FILES[0], { 'proxies': None, 'xelatex': 'xelatex', 'mobigen': 'kindlegen', 'mobilang': '', 'groff': 'groff', 'rhyming_dict': None, 'timestamp': datetime.datetime.today().isoformat()[:19], }))) if not re.search(r'^(https?|file):', options.url): options.url = os.path.abspath(options.url)