Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Benjamin Jakimow
EO Time Series Viewer
Commits
35ea5589
Commit
35ea5589
authored
Sep 10, 2013
by
Guillaume Poulin
Browse files
python3 bugfixes (SVGexpoter)
parent
b2cb6638
Changes
1
Hide whitespace changes
Inline
Side-by-side
pyqtgraph/exporters/SVGExporter.py
View file @
35ea5589
from
.Exporter
import
Exporter
from
pyqtgraph.python2_3
import
asUnicode
from
pyqtgraph.parametertree
import
Parameter
from
pyqtgraph.Qt
import
QtGui
,
QtCore
,
QtSvg
import
pyqtgraph
as
pg
...
...
@@ -91,8 +92,8 @@ class SVGExporter(Exporter):
md
.
setData
(
'image/svg+xml'
,
QtCore
.
QByteArray
(
xml
.
encode
(
'UTF-8'
)))
QtGui
.
QApplication
.
clipboard
().
setMimeData
(
md
)
else
:
with
open
(
fileName
,
'w'
)
as
fh
:
fh
.
write
(
xml
.
encode
(
'UTF-8'
))
with
open
(
fileName
,
'w
t
'
)
as
fh
:
fh
.
write
(
asUnicode
(
xml
))
xmlHeader
=
"""
\
...
...
@@ -221,8 +222,8 @@ def _generateItemSvg(item, nodes=None, root=None):
## this is taken care of in generateSvg instead.
#if hasattr(item, 'setExportMode'):
#item.setExportMode(False)
xmlStr
=
str
(
arr
)
xmlStr
=
bytes
(
arr
).
decode
(
'utf-8'
)
doc
=
xml
.
parseString
(
xmlStr
)
try
:
...
...
@@ -340,7 +341,7 @@ def correctCoordinates(node, item):
if
match
is
None
:
vals
=
[
1
,
0
,
0
,
1
,
0
,
0
]
else
:
vals
=
map
(
float
,
match
.
groups
()[
0
].
split
(
','
)
)
vals
=
[
float
(
a
)
for
a
in
match
.
groups
()[
0
].
split
(
','
)
]
tr
=
np
.
array
([[
vals
[
0
],
vals
[
2
],
vals
[
4
]],
[
vals
[
1
],
vals
[
3
],
vals
[
5
]]])
removeTransform
=
False
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment