Skip to content

Commit

Permalink
Replaces a few items by iteritems.
Browse files Browse the repository at this point in the history
  • Loading branch information
BertrandBordage committed Jun 12, 2012
1 parent e00a937 commit b9aa574
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion xhtml2pdf/paragraph.py
Expand Up @@ -455,7 +455,7 @@ def __init__(self, text, style, debug=False, splitted=False, **kwDict):
self.splitted = splitted

# More attributes
for k, v in kwDict.items():
for k, v in kwDict.iteritems():
setattr(self, k, v)

# set later...
Expand Down
2 changes: 1 addition & 1 deletion xhtml2pdf/paragraph2.py
Expand Up @@ -540,7 +540,7 @@ def __init__(self, text, style, debug=False, splitted=False, **kwDict):
self.splitted = splitted

# More attributes
for k, v in kwDict.items():
for k, v in kwDict.iteritems():
setattr(self, k, v)

# set later...
Expand Down
6 changes: 3 additions & 3 deletions xhtml2pdf/parser.py
Expand Up @@ -53,7 +53,7 @@ def pisaGetAttributes(c, tag, attributes):

attrs = {}
if attributes:
for k, v in attributes.items():
for k, v in attributes.iteritems():
try:
attrs[str(k)] = str(v) # XXX no Unicode! Reportlab fails with template names
except:
Expand All @@ -64,7 +64,7 @@ def pisaGetAttributes(c, tag, attributes):
block, adef = TAGS[tag]
adef["id"] = STRING
# print block, adef
for k, v in adef.items():
for k, v in adef.iteritems():
nattrs[k] = None
# print k, v
# defaults, wenn vorhanden
Expand Down Expand Up @@ -217,7 +217,7 @@ def getCSSAttr(self, cssCascade, attrName, default=NotImplemented):

def getCSSAttrCacheKey(node):
_cl = _id = _st = ''
for i in node.attributes.items():
for i in node.attributes.iteritems():
if i[0] == 'class':
_cl = i[1]
elif i[0] == 'id':
Expand Down
2 changes: 1 addition & 1 deletion xhtml2pdf/util.py
Expand Up @@ -88,7 +88,7 @@ def __init__(self, func):
def __call__(self, *args, **kwargs):
# Make sure the following line is not actually slower than what you're
# trying to memoize
args_plus = tuple(kwargs.items())
args_plus = tuple(kwargs.iteritems())
key = (args, args_plus)
if key not in self.cache:
res = self.func(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion xhtml2pdf/w3c/css.py
Expand Up @@ -540,7 +540,7 @@ def findCSSRuleFor(self, element, attrName):

def mergeStyles(self, styles):
" XXX Bugfix for use in PISA "
for k, v in styles.items():
for k, v in styles.iteritems():
if k in self and self[k]:
self[k] = copy.copy(self[k])
self[k].update(v)
Expand Down

0 comments on commit b9aa574

Please sign in to comment.