示例#1
0
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
示例#2
0
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
示例#3
0
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
示例#4
0
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
示例#5
0
 def test_import_mercurial_mixed(self):
     """Test importing Mercurial project with mixed component/lang"""
     if not HgRepository.is_supported():
         raise SkipTest('Mercurial not available!')
     self.create_project()
     with self.assertRaises(CommandError):
         call_command('import_project',
                      'test',
                      self.mercurial_repo_path,
                      'default',
                      '*/**.po',
                      vcs='mercurial')
示例#6
0
 def test_import_mercurial(self):
     """Test importing Mercurial project"""
     if not HgRepository.is_supported():
         raise SkipTest('Mercurial not available!')
     project = self.create_project()
     call_command('import_project',
                  'test',
                  self.mercurial_repo_path,
                  'default',
                  '**/*.po',
                  vcs='mercurial')
     self.assertEqual(project.component_set.count(), 3)
示例#7
0
 def test_import_mercurial_mixed(self):
     """Test importing Mercurial project with mixed component/lang."""
     if not HgRepository.is_supported():
         raise SkipTest("Mercurial not available!")
     self.create_project()
     with self.assertRaises(CommandError):
         call_command(
             "import_project",
             "test",
             self.mercurial_repo_path,
             "default",
             "*/**.po",
             vcs="mercurial",
         )
示例#8
0
 def test_import_mercurial(self):
     """Test importing Mercurial project."""
     if not HgRepository.is_supported():
         raise SkipTest("Mercurial not available!")
     project = self.create_project()
     call_command(
         "import_project",
         "test",
         self.mercurial_repo_path,
         "default",
         "**/*.po",
         vcs="mercurial",
     )
     self.assertEqual(project.component_set.count(), 4)
示例#9
0
 def test_import_mercurial_mixed(self):
     """Test importing Mercurial project with mixed component/lang"""
     if not HgRepository.is_supported():
         raise SkipTest('Mercurial not available!')
     self.create_project()
     with self.assertRaises(CommandError):
         call_command(
             'import_project',
             'test',
             self.mercurial_repo_path,
             'default',
             '*/**.po',
             vcs='mercurial'
         )
示例#10
0
 def test_import_mercurial(self):
     """Test importing Mercurial project"""
     if not HgRepository.is_supported():
         raise SkipTest('Mercurial not available!')
     project = self.create_project()
     call_command(
         'import_project',
         'test',
         self.mercurial_repo_path,
         'default',
         '**/*.po',
         vcs='mercurial'
     )
     self.assertEqual(project.component_set.count(), 3)