예제 #1
0
 def index_url(self):
     """
         Return the URL in the package index.
     """
     if self.type == PYPI_PYTHON_PKG:
         return "https://pypi.python.org/pypi/%s" % pypi._other_name(self.name)
     elif self.type == RUBYGEM_RUBY_PKG:
         return "https://rubygems.org/gems/%s" % self.name
     elif self.type == NODEJS_PKG:
         return "https://npmjs.org/package/%s" % self.name
     elif self.type == JAVA_MAVEN_PKG:
         [gid, aid] = mavencentral._groupid_artifactid(self.name)
         if self.latest_version:
             return "http://search.maven.org/#artifactdetails|%s|%s|%s|" % (gid, aid, self.latest_version)
         else:
             return "http://search.maven.org/#search|ga|1|g%%3A%%22%s%%22%%20AND%%20a%%3A%%22%s%%22" % (gid, aid)
     elif self.type == PERL_CPAN_PKG:
         return "https://metacpan.org/release/%s" % '-'.join(cpan._other_name(self.name).split('::'))
     elif self.type == PHP_PEAR_PKG:
         return "http://pear.php.net/package/%s" % self.name
     elif self.type == PHP_PEAR2_PKG:
         return "http://pear2.php.net/%s" % self.name
     elif self.type == PHP_PACKAGIST_PKG:
         return "https://packagist.org/packages/%s" % self.name
     elif self.type == GITHUB_TAGGED_PKG:
         return "https://github.com/%s" % self.name
     else:
         return "UNKNOWN"
예제 #2
0
파일: models.py 프로젝트: techtonik/difio
 def index_url(self):
     """
         Return the URL in the package index.
     """
     if self.type == PYPI_PYTHON_PKG:
         return "https://pypi.python.org/pypi/%s" % pypi._other_name(
             self.name)
     elif self.type == RUBYGEM_RUBY_PKG:
         return "https://rubygems.org/gems/%s" % self.name
     elif self.type == NODEJS_PKG:
         return "https://npmjs.org/package/%s" % self.name
     elif self.type == JAVA_MAVEN_PKG:
         [gid, aid] = mavencentral._groupid_artifactid(self.name)
         if self.latest_version:
             return "http://search.maven.org/#artifactdetails|%s|%s|%s|" % (
                 gid, aid, self.latest_version)
         else:
             return "http://search.maven.org/#search|ga|1|g%%3A%%22%s%%22%%20AND%%20a%%3A%%22%s%%22" % (
                 gid, aid)
     elif self.type == PERL_CPAN_PKG:
         return "https://metacpan.org/release/%s" % '-'.join(
             cpan._other_name(self.name).split('::'))
     elif self.type == PHP_PEAR_PKG:
         return "http://pear.php.net/package/%s" % self.name
     elif self.type == PHP_PEAR2_PKG:
         return "http://pear2.php.net/%s" % self.name
     elif self.type == PHP_PACKAGIST_PKG:
         return "https://packagist.org/packages/%s" % self.name
     elif self.type == GITHUB_TAGGED_PKG:
         return "https://github.com/%s" % self.name
     else:
         return "UNKNOWN"
예제 #3
0
def get_tags(package, version):
    author = cpan.get_author_from_html(package, version)

    # HTML doesn't contain info for the latest package.
    # get it using the API
    if not author:
        author = cpan.get_author_from_json(package)

    return "%s/%s-%s" % (author, cpan._other_name(package).replace('::', '-'), version)
예제 #4
0
def get_tags(package, version):
    author = cpan.get_author_from_html(package, version)

    # HTML doesn't contain info for the latest package.
    # get it using the API
    if not author:
        author = cpan.get_author_from_json(package)

    return "%s/%s-%s" % (author, cpan._other_name(package).replace(
        '::', '-'), version)