Commit 9a20d051 authored by Luke Campagnola's avatar Luke Campagnola
Browse files

Fixed unicode support in export file save

parent aff70070
from pyqtgraph.widgets.FileDialog import FileDialog
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore, QtSvg
from pyqtgraph.python2_3 import asUnicode
import os, re
LastExportDirectory = None
......@@ -56,13 +57,13 @@ class Exporter(object):
def fileSaveFinished(self, fileName):
fileName = str(fileName)
fileName = asUnicode(fileName)
global LastExportDirectory
LastExportDirectory = os.path.split(fileName)[0]
## If file name does not match selected extension, append it now
ext = os.path.splitext(fileName)[1].lower().lstrip('.')
selectedExt ='\*\.(\w+)\b', str(self.fileDialog.selectedNameFilter()))
selectedExt ='\*\.(\w+)\b', asUnicode(self.fileDialog.selectedNameFilter()))
if selectedExt is not None:
selectedExt = selectedExt.groups()[0].lower()
if ext != selectedExt:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment