Skip to content
Snippets Groups Projects
Verified Commit a2af496d authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

*: Use less _ in prefix variable names

parent 0837698a
No related branches found
No related tags found
No related merge requests found
......@@ -368,18 +368,18 @@ class PyPIProject:
return []
if not isinstance(release, list):
release = [release]
_releases = []
for _rel in release:
_name = _rel['filename']
_sha256 = _rel['digests']['sha256']
if (_name, _sha256) in known_releases:
releases = []
for rel in release:
name = rel['filename']
sha256 = rel['digests']['sha256']
if (name, sha256) in known_releases:
logging.debug('artifact (%s, %s) already seen for release %s, skipping' % ( # noqa
_name, _sha256, version))
name, sha256, version))
continue
if _rel['packagetype'] != 'sdist':
if rel['packagetype'] != 'sdist':
continue
_releases.append(_rel)
return _releases
releases.append(rel)
return releases
def _cleanup_release_artifacts(self, archive_path, directory_path):
"""Clean intermediary files which no longer needs to be present.
......@@ -407,7 +407,7 @@ class PyPIProject:
"""
for release in releases:
# flatten the metadata to ease reading
_flattenned_release = {
flattened_release = {
'name': version,
'message': release.get('comment_text', ''),
'sha256': release['digests']['sha256'],
......@@ -419,7 +419,7 @@ class PyPIProject:
# fetch and write locally archives
yield self.client.prepare_release_artifact(
self.project, _flattenned_release)
self.project, flattened_release)
def releases(self, known_releases):
"""Fetch metadata/data per release (if new release artifact detected)
......
......@@ -135,22 +135,22 @@ class PyPILoader(SWHLoader):
"""(override) Fetch and collect swh objects.
"""
_last_snapshot = self._last_snapshot()
if _last_snapshot:
self._snapshot = _last_snapshot.copy()
_known_releases = self._known_releases(self._snapshot)
last_snapshot = self._last_snapshot()
if last_snapshot:
self._snapshot = last_snapshot.copy()
known_releases = self._known_releases(self._snapshot)
else:
self._snapshot = {
'branches': {}
}
_known_releases = []
known_releases = []
self._contents = []
self._directories = []
self._revisions = []
for release_info, author, release, dirpath in self.project.releases(
_known_releases):
known_releases):
dirpath = dirpath.encode('utf-8')
directory = Directory.from_disk(path=dirpath, data=True)
_objects = directory.collect()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment