aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility
diff options
context:
space:
mode:
authorBonfaceKilz2020-08-20 16:35:17 +0300
committerBonfaceKilz2020-08-20 16:35:17 +0300
commit1f4fb6b24f3508d80be1f07cd62e38ac9385ef41 (patch)
treebbe3a5966fb4c57b3e10b5550c1cc9c4d90d1b51 /wqflask/utility
parentb32004bc517d9a58be52662297e541c23f60355b (diff)
downloadgenenetwork2-1f4fb6b24f3508d80be1f07cd62e38ac9385ef41.tar.gz
Handle module renames in the standard library
Run: ``` 2to3-3.8 -f imports -w . && \ 2to3-3.8 -f imports2 -w . ``` See: <https://docs.python.org/2/library/2to3.html#2to3fixer-imports> and <https://docs.python.org/2/library/2to3.html#2to3fixer-imports2>
Diffstat (limited to 'wqflask/utility')
-rw-r--r--wqflask/utility/svg.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/wqflask/utility/svg.py b/wqflask/utility/svg.py
index 19eda0ce..b92cc2d1 100644
--- a/wqflask/utility/svg.py
+++ b/wqflask/utility/svg.py
@@ -957,8 +957,8 @@ class drawing:
# Voeg een element toe aan de grafiek toe.
if use_dom_implementation==0:
def toXml(self, filename='',compress=False):
- import cStringIO
- xml=cStringIO.StringIO()
+ import io
+ xml=io.StringIO()
xml.write("<?xml version='1.0' encoding='UTF-8'?>\n")
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:
@@ -971,7 +971,7 @@ class drawing:
if not filename:
if compress:
import gzip
- f=cStringIO.StringIO()
+ f=io.StringIO()
zf=gzip.GzipFile(fileobj=f, mode='wb')
zf.write(xml.getvalue())
zf.close()
@@ -1024,12 +1024,12 @@ class drawing:
return elementroot
root=appender(self.svg, root)
if not filename:
- import cStringIO
- xml=cStringIO.StringIO()
+ import io
+ xml=io.StringIO()
PrettyPrint(root, xml)
if compress:
import gzip
- f=cStringIO.StringIO()
+ f=io.StringIO()
zf=gzip.GzipFile(fileobj=f, mode='wb')
zf.write(xml.getvalue())
zf.close()
@@ -1041,8 +1041,8 @@ class drawing:
try:
if filename[-4:]=='svgz':
import gzip
- import cStringIO
- xml=cStringIO.StringIO()
+ import io
+ xml=io.StringIO()
PrettyPrint(root, xml)
f=gzip.GzipFile(filename=filename, mode='wb', compresslevel=9)
f.write(xml.getvalue())