def get_optional_versions(): """Return versions of optional modules.""" result = [] for name in OPTIONAL: module = get_version_module(name, True) if module is not None: result.append(module) if HgRepository.is_supported(): result.append(("Mercurial", "https://www.mercurial-scm.org/", HgRepository.get_version())) if SubversionRepository.is_supported(): result.append(( "git-svn", "https://git-scm.com/docs/git-svn", SubversionRepository.get_version(), )) if GitWithGerritRepository.is_supported(): result.append(( "git-review", "https://pypi.org/project/git-review/", GitWithGerritRepository.get_version(), )) return result
def post_migrate(self, sender, **kwargs): ensure_ssh_key() home = data_dir("home") # Configure merge driver for Gettext PO # We need to do this behind lock to avoid errors when servers # start in parallel lockfile = WeblateLock(home, "gitlock", 0, "", "lock:{scope}", "{scope}", timeout=120) with lockfile: try: GitRepository.global_setup() except RepositoryException as error: GIT_ERRORS.append(str(error)) if SubversionRepository.is_supported(): try: SubversionRepository.global_setup() except RepositoryException as error: GIT_ERRORS.append(str(error)) # Use it for *.po by default configdir = os.path.join(home, ".config", "git") configfile = os.path.join(configdir, "attributes") if not os.path.exists(configfile): if not os.path.exists(configdir): os.makedirs(configdir) with open(configfile, "w") as handle: handle.write("*.po merge=weblate-merge-gettext-po\n")
def get_optional_versions(): """Return versions of optional modules.""" result = [] get_optional_module( result, 'pytz', 'pytz', 'https://pypi.org/project/pytz/' ) get_optional_module( result, 'pyuca', 'pyuca', 'https://github.com/jtauber/pyuca' ) get_optional_module( result, 'bidi', 'python-bidi', 'https://github.com/MeirKriheli/python-bidi' ) get_optional_module( result, 'yaml', 'PyYAML', 'https://pyyaml.org/wiki/PyYAML' ) get_optional_module( result, 'tesserocr', 'tesserocr', 'https://github.com/sirfz/tesserocr' ) if HgRepository.is_supported(): result.append(( 'Mercurial', 'https://www.mercurial-scm.org/', HgRepository.get_version(), '2.8', )) if SubversionRepository.is_supported(): result.append(( 'git-svn', 'https://git-scm.com/docs/git-svn', SubversionRepository.get_version(), '1.6', )) if GitWithGerritRepository.is_supported(): result.append(( 'git-review', 'https://pypi.org/project/git-review/', GitWithGerritRepository.get_version(), '1.0', )) if GithubRepository.is_supported(): result.append(( 'hub', 'https://hub.github.com/', GithubRepository.get_version(), '1.0', )) return result
def get_optional_versions(): """Return versions of optional modules.""" result = [] get_optional_module( result, 'ruamel.yaml', 'https://pypi.org/project/ruamel.yaml/' ) get_optional_module( result, 'tesserocr', 'https://github.com/sirfz/tesserocr' ) if HgRepository.is_supported(): result.append(( 'Mercurial', 'https://www.mercurial-scm.org/', HgRepository.get_version(), '2.8', )) if SubversionRepository.is_supported(): result.append(( 'git-svn', 'https://git-scm.com/docs/git-svn', SubversionRepository.get_version(), '1.6', )) if GitWithGerritRepository.is_supported(): result.append(( 'git-review', 'https://pypi.org/project/git-review/', GitWithGerritRepository.get_version(), '1.0', )) if GithubRepository.is_supported(): result.append(( 'hub', 'https://hub.github.com/', GithubRepository.get_version(), '1.0', )) return result