Commit db086665 authored by Kai Willadsen's avatar Kai Willadsen

Replace iteritems/itervalues with items/values for Python 3 compat

While in theory these changes could cause worse performance under
Python 2, the areas in which these calls occurred are very unlikely to
have any performance impact.
parent 0bd6257f
......@@ -110,7 +110,7 @@ class DiffMap(gtk.DrawingArea):
for c, y0, y1 in self._difffunc():
tagged_diffs[c].append((y0, y1))
for tag, diffs in tagged_diffs.iteritems():
for tag, diffs in tagged_diffs.items():
context.set_source_color(self.fill_colors[tag])
for y0, y1 in diffs:
y0, y1 = round(y0 * height) - 0.5, round(y1 * height) - 0.5
......
......@@ -194,7 +194,7 @@ class CanonicalListing(object):
def get(self):
first = lambda seq: next(s for s in seq if s)
filled = lambda seq: tuple([s or first(seq) for s in seq])
return sorted([filled(v) for v in self.items.itervalues()])
return sorted(filled(v) for v in self.items.values())
################################################################################
......
......@@ -113,7 +113,7 @@ class Vc(_vc.CachedVc):
retfiles = []
retdirs = []
bzrfiles = {}
for path,state in tree.iteritems():
for path, state in tree.items():
mydir, name = os.path.split(path)
if path.endswith('/'):
mydir, name = os.path.split(mydir)
......
......@@ -123,7 +123,7 @@ class Vc(_vc.CachedVc):
retdirs = []
vcfiles = {}
for path, state in tree.iteritems():
for path, state in tree.items():
mydir, name = os.path.split(path)
if path.endswith('/'):
mydir, name = os.path.split(mydir)
......@@ -164,7 +164,7 @@ class Vc(_vc.CachedVc):
'manifest.uuid']
if f not in ignorelist:
print "WARNING: '%s' was not listed by 'ls -l'" % f
print("WARNING: '%s' was not listed by 'ls -l'" % f)
# If it ain't listed by the inventory it's not under version
# control
......
......@@ -187,7 +187,7 @@ class Vc(_vc.CachedVc):
for name,path in dirs:
# git does not operate on dirs, just files
retdirs.append( _vc.Dir(path, name, _vc.STATE_NORMAL))
for path, state in tree.iteritems():
for path, state in tree.items():
# removed files are not in the filesystem, so must be added here
if state is _vc.STATE_REMOVED:
folder, name = os.path.split(path)
......
......@@ -129,7 +129,7 @@ class Vc(_vc.CachedVc):
for name, path in dirs:
# mercurial does not operate on dirs, just files
retdirs.append(_vc.Dir(path, name, _vc.STATE_NORMAL))
for path, state in tree.iteritems():
for path, state in tree.items():
# removed files are not in the filesystem, so must be added here
if state is _vc.STATE_REMOVED:
folder, name = os.path.split(path)
......
......@@ -234,7 +234,7 @@ class Vc(_vc.CachedVc):
retdirs = []
vcfiles = {}
for path,state in tree.iteritems():
for path, state in tree.items():
mydir, name = os.path.split(path)
if path.endswith('/'):
mydir, name = os.path.split(mydir)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment