def adjust_installation_command(): extra_options = [] if dependency_links: extra_options += ["--process-dependency-links"] if version.is_prerelease(): extra_options += ["--pre"] for ln, line in enumerate(readme_lines): if re.match(r"^\s*pip install\s+.*\s+Pootle$", line): if extra_options: readme_lines[ln] = " pip install %s Pootle\n" % " ".join(extra_options) else: readme_lines[ln] = " pip install Pootle\n"
def adjust_installation_command(): extra_options = [] if dependency_links: extra_options += ["--process-dependency-links"] if version.is_prerelease(): extra_options += ["--pre"] for ln, line in enumerate(readme_lines): if re.match(r'^\s*pip install\s+.*\s+Pootle$', line): if extra_options: readme_lines[ln] = ( " pip install %s Pootle\n" % " ".join(extra_options)) else: readme_lines[ln] = " pip install Pootle\n"
# :role: (URL, prefix) 'issue': ('https://github.com/translate/pootle/issues/%s', 'issue '), 'man': ('http://linux.die.net/man/1/%s', ''), 'wiki': ('http://translate.sourceforge.net/wiki/%s', ''), 'wp': ('https://en.wikipedia.org/wiki/%s', ''), } # -- Dependency versions ---- install_options = [] requirements_dir = '../requirements' for requirement in os.listdir(requirements_dir): with open(os.path.join(requirements_dir, requirement)) as req: for line in req.readlines(): if re.match(r'^\s*-e\s+', line): install_options += ["--process-dependency-links"] break if pootle_version.is_prerelease(): install_options += ["--pre"] if install_options: install_options_string = " ".join(install_options) else: install_options_string = "\\" rst_prolog = """ .. |django_ver| replace:: %s .. |ttk_ver| replace:: %s .. |--process-dependency-links --pre| replace:: %s """ % (dj_version_actual, ttk_version_actual, install_options_string)
extlinks = { # :role: (URL, prefix) 'issue': ('https://github.com/translate/pootle/issues/%s', 'issue '), 'man': ('http://linux.die.net/man/1/%s', ''), 'wiki': ('http://translate.sourceforge.net/wiki/%s', ''), 'wp': ('https://en.wikipedia.org/wiki/%s', ''), } # -- Dependency versions ---- install_options = set() requirements_dir = '../requirements' for requirement in os.listdir(requirements_dir): with open(os.path.join(requirements_dir, requirement)) as req: for line in req.readlines(): if re.match(r'^\s*-e\s+', line): install_options.add("--process-dependency-links") break if pootle_version.is_prerelease(): install_options.add("--pre") if install_options: install_options_string = " ".join(install_options) else: install_options_string = "\\" rst_prolog = """ .. |django_ver| replace:: %s .. |ttk_ver| replace:: %s .. |--process-dependency-links --pre| replace:: %s """ % (dj_version_actual, ttk_version_actual, install_options_string)