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
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
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
def _package(self): package = entities.Package(NAME) package.store_release(entities.Release(VERSION)) return package
def _cached(self): package = entities.Package(PACKAGE) package.store_release(entities.Release(CACHED_RELEASE)) return package
def _pypi(self): package = entities.Package(PACKAGE) package.store_release(entities.Release(PYPI_RELEASE)) return package