Commit c5ede16c0524d757547d970206dcb270ed69dbad
1 parent
1d21c8fc
Exists in
master
and in
6 other branches
FIX: bug in open directory in the Windows
Showing
4 changed files
with
9 additions
and
5 deletions
Show diff stats
invesalius/control.py
... | ... | @@ -258,12 +258,15 @@ class Controller(): |
258 | 258 | |
259 | 259 | def OnSaveProject(self, pubsub_evt): |
260 | 260 | filename = prj.Project().name |
261 | + filename = filename.replace(' ','') | |
261 | 262 | dir_ = tempfile.mkdtemp(filename) |
262 | 263 | prj.Project().SavePlistProject(dir_, filename) |
263 | 264 | |
264 | 265 | def OnOpenProject(self, pubsub_evt): |
265 | - filename = pubsub_evt.data | |
266 | - | |
266 | + filename = os.path.abspath(pubsub_evt.data) | |
267 | + | |
268 | + print filename | |
269 | + | |
267 | 270 | proj = prj.Project() |
268 | 271 | proj.OpenPlistProject(filename) |
269 | 272 | proj.SetAcquisitionModality(proj.modality) | ... | ... |
invesalius/data/mask.py
... | ... | @@ -61,7 +61,7 @@ class Mask(): |
61 | 61 | |
62 | 62 | def OpenPList(self, filename): |
63 | 63 | mask = plistlib.readPlist(filename) |
64 | - dirpath = os.path.split(filename)[0] | |
64 | + dirpath = os.path.abspath(os.path.split(filename)[0]) | |
65 | 65 | for key in mask: |
66 | 66 | print "Key", key |
67 | 67 | if key == 'imagedata': | ... | ... |
invesalius/data/surface.py
... | ... | @@ -61,7 +61,7 @@ class Surface(): |
61 | 61 | |
62 | 62 | def OpenPList(self, filename): |
63 | 63 | surface = plistlib.readPlist(filename) |
64 | - dirpath = os.path.split(filename)[0] | |
64 | + dirpath = os.path.abspath(os.path.split(filename)[0]) | |
65 | 65 | for key in surface: |
66 | 66 | if key == 'polydata': |
67 | 67 | filepath = os.path.split(surface[key]["$vtp"])[-1] | ... | ... |
invesalius/project.py
... | ... | @@ -147,6 +147,7 @@ class Project(object): |
147 | 147 | |
148 | 148 | def SavePlistProject(self, dir_, filename): |
149 | 149 | filename = os.path.join(dir_, filename) |
150 | + | |
150 | 151 | project = {} |
151 | 152 | |
152 | 153 | for key in self.__dict__: |
... | ... | @@ -187,7 +188,7 @@ class Project(object): |
187 | 188 | #print "antes", self.__dict__ |
188 | 189 | |
189 | 190 | # Path were extracted project is |
190 | - dirpath = os.path.split(filelist[0])[0] | |
191 | + dirpath = os.path.abspath(os.path.split(filelist[0])[0]) | |
191 | 192 | #print "* dirpath", dirpath |
192 | 193 | |
193 | 194 | for key in project: | ... | ... |