Commit caee8fc8eefc9e0ad4025fc9f4045b8216cefc6e
1 parent
ed5fcc9b
FIX: inv3 file save in temp and unicode chars in path of dicom to be imported
Showing
3 changed files
with
9 additions
and
7 deletions
Show diff stats
invesalius/data/measures.py
... | ... | @@ -62,9 +62,6 @@ class MeasurementManager(object): |
62 | 62 | else: |
63 | 63 | ps.Publisher().sendMessage('Update slice viewer') |
64 | 64 | |
65 | - session = ses.Session() | |
66 | - session.SaveProject() | |
67 | - | |
68 | 65 | def _add_point(self, pubsub_evt): |
69 | 66 | position = pubsub_evt.data[0] |
70 | 67 | type = pubsub_evt.data[1] # Linear or Angular | ... | ... |
invesalius/invesalius.py
... | ... | @@ -27,9 +27,10 @@ import sys |
27 | 27 | if sys.platform == 'win32': |
28 | 28 | import _winreg |
29 | 29 | |
30 | -import wxversion | |
31 | -wxversion.ensureMinimal('2.8-unicode', optionsRequired=True) | |
32 | -wxversion.select('2.8-unicode', optionsRequired=True) | |
30 | +if sys.platform != 'win32': | |
31 | + import wxversion | |
32 | + wxversion.ensureMinimal('2.8-unicode', optionsRequired=True) | |
33 | + wxversion.select('2.8-unicode', optionsRequired=True) | |
33 | 34 | |
34 | 35 | import wx |
35 | 36 | import wx.lib.pubsub as ps | ... | ... |
invesalius/session.py
1 | 1 | import ConfigParser |
2 | 2 | import os |
3 | 3 | import shutil |
4 | +import sys | |
4 | 5 | from threading import Thread |
5 | 6 | import time |
6 | 7 | |
... | ... | @@ -138,7 +139,10 @@ class Session(object): |
138 | 139 | config.add_section('paths') |
139 | 140 | config.set('paths','homedir',self.homedir) |
140 | 141 | config.set('paths','tempdir',self.tempdir) |
141 | - config.set('paths','last_dicom_folder',self.last_dicom_folder.encode('utf-8')) | |
142 | + try: | |
143 | + config.set('paths','last_dicom_folder',self.last_dicom_folder.encode('utf-8')) | |
144 | + except (UnicodeEncodeError, UnicodeDecodeError): | |
145 | + config.set('paths','last_dicom_folder',self.last_dicom_folder) | |
142 | 146 | path = os.path.join(self.homedir , |
143 | 147 | '.invesalius', 'config.cfg') |
144 | 148 | ... | ... |