Commit d6611774f3f5755d10f96c0b998ad67f0da7a99b
1 parent
b0fe7063
Exists in
master
Fixed plist access denied files on .exe
Showing
3 changed files
with
4 additions
and
4 deletions
Show diff stats
invesalius/control.py
... | ... | @@ -1085,7 +1085,7 @@ class Controller(): |
1085 | 1085 | if not os.path.isfile(path): |
1086 | 1086 | path = os.path.join(inv_paths.USER_RAYCASTING_PRESETS_DIRECTORY, |
1087 | 1087 | preset_name+".plist") |
1088 | - with open(path, 'r+b') as f: | |
1088 | + with open(path, 'rb') as f: | |
1089 | 1089 | preset = plistlib.load(f, fmt=plistlib.FMT_XML) |
1090 | 1090 | prj.Project().raycasting_preset = preset |
1091 | 1091 | # Notify volume | ... | ... |
invesalius/data/volume.py
... | ... | @@ -356,7 +356,7 @@ class Volume(): |
356 | 356 | if color_preset != "No CLUT": |
357 | 357 | path = os.path.join(inv_paths.RAYCASTING_PRESETS_DIRECTORY, |
358 | 358 | 'color_list', color_preset + '.plist') |
359 | - with open(path, 'r+b') as f: | |
359 | + with open(path, 'rb') as f: | |
360 | 360 | p = plistlib.load(f, fmt=plistlib.FMT_XML) |
361 | 361 | |
362 | 362 | r = p['Red'] | ... | ... |
invesalius/presets.py
... | ... | @@ -155,7 +155,7 @@ class Presets(): |
155 | 155 | "Custom":_("Custom")} |
156 | 156 | |
157 | 157 | |
158 | - with open(filename, 'r+b') as f: | |
158 | + with open(filename, 'rb') as f: | |
159 | 159 | p = plistlib.load(f, fmt=plistlib.FMT_XML) |
160 | 160 | thresh_mri = p['thresh_mri'].copy() |
161 | 161 | thresh_ct = p['thresh_ct'].copy() |
... | ... | @@ -183,7 +183,7 @@ def get_wwwl_presets(): |
183 | 183 | |
184 | 184 | |
185 | 185 | def get_wwwl_preset_colours(pfile): |
186 | - with open(pfile, 'r+b') as f: | |
186 | + with open(pfile, 'rb') as f: | |
187 | 187 | preset = plistlib.load(f, fmt=plistlib.FMT_XML) |
188 | 188 | ncolours = len(preset['Blue']) |
189 | 189 | colours = [] | ... | ... |