Exemple #1
0
    def _package(self):
        package = entities.Package(NAME)
        release = entities.Release(VERSION)
        release.add_file(entities.File(FILENAME, None, None))
        package.store_release(release)

        return package
Exemple #2
0
    def _deserialize_release(self, result):
        release = entities.Release(result[u'version'])
        self._inject_fields(release, result, exclude=[u'files'])

        for file_ in result[u'files']:
            release.add_file(
                entities.File(file_[u'name'], file_[u'filetype'],
                              file_['md5_digest']))

        return release
Exemple #3
0
    def get_by_name(self, name, version=None):
        response = self._query_pypi(name, version)

        package = entities.Package(name)
        package.is_from_pypi = True
        release = entities.Release(response['info'][u'version'])

        for key, value in response['info'].iteritems():
            if hasattr(release, key) and value != 'UNKNOWN':
                setattr(release, key, value)

        package.store_release(release)
        return package
Exemple #4
0
    def _package(self):
        package = entities.Package(NAME)
        package.store_release(entities.Release(VERSION))

        return package
Exemple #5
0
    def _cached(self):
        package = entities.Package(PACKAGE)
        package.store_release(entities.Release(CACHED_RELEASE))

        return package
Exemple #6
0
    def _pypi(self):
        package = entities.Package(PACKAGE)
        package.store_release(entities.Release(PYPI_RELEASE))

        return package