Пример #1
0
def get_optional_versions():
    '''
    Returns versions of optional modules.
    '''
    result = []

    get_optional_module(result, 'pytz', 'pytz',
                        'https://pypi.python.org/pypi/pytz/')

    get_optional_module(result, 'pyuca', 'pyuca',
                        'https://github.com/jtauber/pyuca', None)

    get_optional_module(result, 'bidi', 'python-bidi',
                        'https://github.com/MeirKriheli/python-bidi',
                        'VERSION')

    get_optional_module(result, 'libravatar', 'pyLibravatar',
                        'https://pypi.python.org/pypi/pyLibravatar', None)

    get_optional_module(result, 'yaml', 'PyYAML',
                        'http://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.python.org/pypi/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
Пример #2
0
 def setUp(self):
     super(MultiRepoTest, self).setUp()
     if self._vcs == 'git':
         repo = self.git_repo_path
         push = self.git_repo_path
     elif self._vcs == 'subversion':
         if not SubversionRepository.is_supported():
             raise SkipTest('Subversion not available!')
         repo = 'file://' + self.svn_repo_path
         push = 'file://' + self.svn_repo_path
     else:
         if not HgRepository.is_supported():
             raise SkipTest('Mercurial not available!')
         repo = self.hg_repo_path
         push = self.hg_repo_path
     self.subproject2 = SubProject.objects.create(
         name='Test 2',
         slug='test-2',
         project=self.project,
         repo=repo,
         push=push,
         vcs=self._vcs,
         filemask='po/*.po',
         template='',
         file_format='po',
         repoweb=REPOWEB_URL,
         new_base='',
     )
     self.request = self.get_request('/')
Пример #3
0
 def setUp(self):
     super(MultiRepoTest, self).setUp()
     if self._vcs == 'git':
         repo = self.git_repo_path
         push = self.git_repo_path
     elif self._vcs == 'subversion':
         if not SubversionRepository.is_supported():
             raise SkipTest('Subversion not available!')
         repo = 'file://' + self.svn_repo_path
         push = 'file://' + self.svn_repo_path
     else:
         if not HgRepository.is_supported():
             raise SkipTest('Mercurial not available!')
         repo = self.hg_repo_path
         push = self.hg_repo_path
     self.subproject2 = SubProject.objects.create(
         name='Test 2',
         slug='test-2',
         project=self.project,
         repo=repo,
         push=push,
         vcs=self._vcs,
         filemask=self._filemask,
         template='',
         file_format='po',
         repoweb=REPOWEB_URL,
         new_base='',
         branch=self._branch,
     )
     self.request = self.get_request('/')
Пример #4
0
    def _create_subproject(self,
                           file_format,
                           mask,
                           template='',
                           new_base='',
                           vcs='git',
                           branch=None,
                           **kwargs):
        """Create real test subproject."""
        if file_format not in FILE_FORMATS:
            raise SkipTest(
                'File format {0} is not supported!'.format(file_format))
        if 'project' not in kwargs:
            kwargs['project'] = self.create_project()

        if vcs == 'mercurial':
            d_branch = 'default'
            repo = self.hg_repo_path
            push = self.hg_repo_path
            if not HgRepository.is_supported():
                raise SkipTest('Mercurial not available!')
        elif vcs == 'subversion':
            d_branch = 'master'
            repo = 'file://' + self.svn_repo_path
            push = 'file://' + self.svn_repo_path
            if not SubversionRepository.is_supported():
                raise SkipTest('Subversion not available!')
        else:
            d_branch = 'master'
            repo = self.git_repo_path
            push = self.git_repo_path

        if 'new_lang' not in kwargs:
            kwargs['new_lang'] = 'contact'

        if 'push_on_commit' not in kwargs:
            kwargs['push_on_commit'] = False

        if branch is None:
            branch = d_branch

        return SubProject.objects.create(name='Test',
                                         slug='test',
                                         repo=repo,
                                         push=push,
                                         branch=branch,
                                         filemask=mask,
                                         template=template,
                                         file_format=file_format,
                                         repoweb=REPOWEB_URL,
                                         save_history=True,
                                         new_base=new_base,
                                         vcs=vcs,
                                         **kwargs)
Пример #5
0
    def _create_subproject(self, file_format, mask, template='',
                           new_base='', vcs='git', branch=None, **kwargs):
        """
        Creates real test subproject.
        """
        if 'project' not in kwargs:
            kwargs['project'] = self.create_project()

        if vcs == 'mercurial':
            d_branch = 'default'
            repo = self.hg_repo_path
            push = self.hg_repo_path
            if not HgRepository.is_supported():
                raise SkipTest('Mercurial not available!')
        elif vcs == 'subversion':
            d_branch = 'master'
            repo = 'file://' + self.svn_repo_path
            push = 'file://' + self.svn_repo_path
            if not SubversionRepository.is_supported():
                raise SkipTest('Subversion not available!')
        else:
            d_branch = 'master'
            repo = self.git_repo_path
            push = self.git_repo_path

        if 'new_lang' not in kwargs:
            kwargs['new_lang'] = 'contact'

        if branch is None:
            branch = d_branch

        return SubProject.objects.create(
            name='Test',
            slug='test',
            repo=repo,
            push=push,
            branch=branch,
            filemask=mask,
            template=template,
            file_format=file_format,
            repoweb=REPOWEB_URL,
            save_history=True,
            new_base=new_base,
            vcs=vcs,
            **kwargs
        )
Пример #6
0
def get_optional_versions():
    '''
    Returns versions of optional modules.
    '''
    result = []

    name = 'pytz'
    url = 'https://pypi.python.org/pypi/pytz/'
    mod = get_version_module('pytz', name, url, True)
    if mod is not None:
        result.append((
            name,
            url,
            mod.__version__,
            None,
        ))

    name = 'pyuca'
    url = 'https://github.com/jtauber/pyuca'
    mod = get_version_module('pyuca', name, url, True)
    if mod is not None:
        result.append((
            name,
            url,
            'N/A',
            None,
        ))

    name = 'python-bidi'
    url = 'https://github.com/MeirKriheli/python-bidi'
    mod = get_version_module('bidi', name, url, True)
    if mod is not None:
        result.append((
            name,
            url,
            mod.VERSION,
            None,
        ))

    name = 'pyLibravatar'
    url = 'https://pypi.python.org/pypi/pyLibravatar'
    mod = get_version_module('libravatar', name, url, True)
    if mod is not None:
        result.append((
            name,
            url,
            'N/A',
            None,
        ))

    if HgRepository.is_supported():
        result.append((
            'Mercurial',
            'http://mercurial.selenic.com/',
            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.python.org/pypi/git-review',
            GitWithGerritRepository.get_version(),
            '1.0',
        ))

    return result
Пример #7
0
def get_optional_versions():
    '''
    Returns versions of optional modules.
    '''
    result = []

    name = 'pytz'
    url = 'https://pypi.python.org/pypi/pytz/'
    mod = get_version_module('pytz', name, url, True)
    if mod is not None:
        result.append((
            name,
            url,
            mod.__version__,
            None,
        ))

    name = 'pyuca'
    url = 'https://github.com/jtauber/pyuca'
    mod = get_version_module('pyuca', name, url, True)
    if mod is not None:
        result.append((
            name,
            url,
            'N/A',
            None,
        ))

    name = 'python-bidi'
    url = 'https://github.com/MeirKriheli/python-bidi'
    mod = get_version_module('bidi', name, url, True)
    if mod is not None:
        result.append((
            name,
            url,
            mod.VERSION,
            None,
        ))

    name = 'pyLibravatar'
    url = 'https://pypi.python.org/pypi/pyLibravatar'
    mod = get_version_module('libravatar', name, url, True)
    if mod is not None:
        result.append((
            name,
            url,
            'N/A',
            None,
        ))

    name = 'PyYAML'
    url = 'http://pyyaml.org/wiki/PyYAML'
    mod = get_version_module('yaml', name, url, True)
    if mod is not None:
        result.append((
            name,
            url,
            mod.__version__,
            None,
        ))

    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.python.org/pypi/git-review',
            GitWithGerritRepository.get_version(),
            '1.0',
        ))

    return result
Пример #8
0
def get_optional_versions():
    """Return versions of optional modules."""
    result = []

    get_optional_module(
        result, 'pytz', 'pytz', 'https://pypi.python.org/pypi/pytz/'
    )

    get_optional_module(
        result, 'pyuca', 'pyuca', 'https://github.com/jtauber/pyuca', None
    )

    get_optional_module(
        result, 'bidi', 'python-bidi',
        'https://github.com/MeirKriheli/python-bidi', 'VERSION'
    )

    get_optional_module(
        result, 'libravatar', 'pyLibravatar',
        'https://pypi.python.org/pypi/pyLibravatar', None
    )

    get_optional_module(
        result, 'yaml', 'PyYAML', 'http://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.python.org/pypi/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