aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/svg.py
diff options
context:
space:
mode:
authorBonfaceKilz2020-08-19 02:31:31 +0300
committerBonfaceKilz2020-08-19 02:34:42 +0300
commitba123e1e0fe693f9778993c3f8e5a70a28658a4c (patch)
tree6d02bac212da1bfeeb8330b94971383cde053602 /wqflask/utility/svg.py
parentbafbb5b7a4b7db2ca230f292eb45be7e67985259 (diff)
downloadgenenetwork2-ba123e1e0fe693f9778993c3f8e5a70a28658a4c.tar.gz
Fix dictionary iteration methods
Run `2to3-3.8 -f dict -w .` See: <https://docs.python.org/2/library/2to3.html#2to3fixer-dict> and <https://stackoverflow.com/questions/17695456/why-does-python-3-need-dict-items-to-be-wrapped-with-list>
Diffstat (limited to 'wqflask/utility/svg.py')
-rw-r--r--wqflask/utility/svg.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/wqflask/utility/svg.py b/wqflask/utility/svg.py
index d66c954e..c6a5c260 100644
--- a/wqflask/utility/svg.py
+++ b/wqflask/utility/svg.py
@@ -133,7 +133,7 @@ def _escape(data, entities={}):
# data = data.replace("&", "&amp;")
data = data.replace("<", "&lt;")
data = data.replace(">", "&gt;")
- for chars, entity in entities.items():
+ for chars, entity in list(entities.items()):
data = data.replace(chars, entity)
return data
@@ -299,7 +299,7 @@ class SVGelement:
self.text = text
self.namespace = namespace
self.cdata = cdata
- for arg in args.keys():
+ for arg in list(args.keys()):
arg2 = arg.replace("__", ":")
arg2 = arg2.replace("_", "-")
self.attributes[arg2] = args[arg]
@@ -314,7 +314,7 @@ class SVGelement:
def toXml(self, level, f):
f.write('\t'*level)
f.write('<'+self.type)
- for attkey in self.attributes.keys():
+ for attkey in list(self.attributes.keys()):
f.write(' '+_escape(str(attkey))+'=' +
_quoteattr(str(self.attributes[attkey])))
if self.namespace:
@@ -365,7 +365,7 @@ class tspan(SVGelement):
def __repr__(self):
s = "<tspan"
- for key, value in self.attributes.items():
+ for key, value in list(self.attributes.items()):
s += ' %s="%s"' % (key, value)
s += '>'
s += self.text
@@ -390,7 +390,7 @@ class tref(SVGelement):
def __repr__(self):
s = "<tref"
- for key, value in self.attributes.items():
+ for key, value in list(self.attributes.items()):
s += ' %s="%s"' % (key, value)
s += '/>'
return s
@@ -963,7 +963,7 @@ class drawing:
xml.write("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\"")
if self.entity:
xml.write(" [\n")
- for item in self.entity.keys():
+ for item in list(self.entity.keys()):
xml.write("<!ENTITY %s \"%s\">\n" % (item, self.entity[item]))
xml.write("]")
xml.write(">\n")
@@ -1015,7 +1015,7 @@ class drawing:
if element.text:
textnode=root.createTextNode(element.text)
e.appendChild(textnode)
- for attribute in element.attributes.keys(): #in element.attributes is supported from python 2.2
+ for attribute in list(element.attributes.keys()): #in element.attributes is supported from python 2.2
e.setAttribute(attribute,str(element.attributes[attribute]))
if element.elements:
for el in element.elements: