Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Unified Diff: Lib/packaging/database.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/packaging/command/upload.py ('k') | Lib/packaging/install.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/packaging/database.py Tue Jul 26 09:37:46 2011 +0300
+++ b/Lib/packaging/database.py Mon Jul 25 09:47:18 2011 -0400
@@ -61,12 +61,13 @@
def clear_cache():
""" Clears the internal cache. """
- global _cache_generated, _cache_generated_egg
+ global _cache_name, _cache_name_egg, _cache_path, _cache_path_egg, \
+ _cache_generated, _cache_generated_egg
- _cache_name.clear()
- _cache_name_egg.clear()
- _cache_path.clear()
- _cache_path_egg.clear()
+ _cache_name = {}
+ _cache_name_egg = {}
+ _cache_path = {}
+ _cache_path_egg = {}
_cache_generated = False
_cache_generated_egg = False
@@ -157,18 +158,17 @@
self.name, self.version, self.path)
def _get_records(self, local=False):
- results = []
with self.get_distinfo_file('RECORD') as record:
record_reader = csv.reader(record, delimiter=',',
lineterminator='\n')
+ # XXX needs an explaining comment
for row in record_reader:
- missing = [None for i in range(len(row), 3)]
- path, checksum, size = row + missing
+ path, checksum, size = (row[:] +
+ [None for i in range(len(row), 3)])
if local:
path = path.replace('/', os.sep)
path = os.path.join(sys.prefix, path)
- results.append((path, checksum, size))
- return results
+ yield path, checksum, size
def get_resource_path(self, relative_path):
with self.get_distinfo_file('RESOURCES') as resources_file:
@@ -197,8 +197,7 @@
:type local: boolean
:returns: iterator of (path, md5, size)
"""
- for result in self._get_records(local):
- yield result
+ return self._get_records(local)
def uses(self, path):
"""
« no previous file with comments | « Lib/packaging/command/upload.py ('k') | Lib/packaging/install.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+