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
9a20d051
Commit
9a20d051
authored
May 31, 2013
by
Luke Campagnola
Browse files
Fixed unicode support in export file save
parent
aff70070
Changes
1
Hide whitespace changes
Inline
Side-by-side
pyqtgraph/exporters/Exporter.py
View file @
9a20d051
from
pyqtgraph.widgets.FileDialog
import
FileDialog
from
pyqtgraph.widgets.FileDialog
import
FileDialog
import
pyqtgraph
as
pg
import
pyqtgraph
as
pg
from
pyqtgraph.Qt
import
QtGui
,
QtCore
,
QtSvg
from
pyqtgraph.Qt
import
QtGui
,
QtCore
,
QtSvg
from
pyqtgraph.python2_3
import
asUnicode
import
os
,
re
import
os
,
re
LastExportDirectory
=
None
LastExportDirectory
=
None
...
@@ -56,13 +57,13 @@ class Exporter(object):
...
@@ -56,13 +57,13 @@ class Exporter(object):
return
return
def
fileSaveFinished
(
self
,
fileName
):
def
fileSaveFinished
(
self
,
fileName
):
fileName
=
str
(
fileName
)
fileName
=
asUnicode
(
fileName
)
global
LastExportDirectory
global
LastExportDirectory
LastExportDirectory
=
os
.
path
.
split
(
fileName
)[
0
]
LastExportDirectory
=
os
.
path
.
split
(
fileName
)[
0
]
## If file name does not match selected extension, append it now
## If file name does not match selected extension, append it now
ext
=
os
.
path
.
splitext
(
fileName
)[
1
].
lower
().
lstrip
(
'.'
)
ext
=
os
.
path
.
splitext
(
fileName
)[
1
].
lower
().
lstrip
(
'.'
)
selectedExt
=
re
.
search
(
r
'\*\.(\w+)\b'
,
str
(
self
.
fileDialog
.
selectedNameFilter
()))
selectedExt
=
re
.
search
(
r
'\*\.(\w+)\b'
,
asUnicode
(
self
.
fileDialog
.
selectedNameFilter
()))
if
selectedExt
is
not
None
:
if
selectedExt
is
not
None
:
selectedExt
=
selectedExt
.
groups
()[
0
].
lower
()
selectedExt
=
selectedExt
.
groups
()[
0
].
lower
()
if
ext
!=
selectedExt
:
if
ext
!=
selectedExt
:
...
...
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