Commit 9f47af2795176f132dd2922aa4fe9ad46c274cf4

Authored by tatiana
1 parent a633461f

FIX: #83 (when directory .invesalius doesn't exist)

Showing 1 changed file with 5 additions and 8 deletions   Show diff stats
invesalius/constants.py
... ... @@ -246,11 +246,13 @@ TYPE_RAYCASTING_MAPPER = 1
246 246 folder=RAYCASTING_PRESETS_DIRECTORY= os.path.abspath(os.path.join("..",
247 247 "presets",
248 248 "raycasting"))
249   -
250 249 RAYCASTING_TYPES = [filename.split(".")[0] for filename in
251 250 os.listdir(folder) if
252 251 os.path.isfile(os.path.join(folder,filename))]
  252 +
253 253 folder = os.path.join(os.path.expanduser('~'), '.invesalius', 'presets')
  254 +if not os.path.isdir(folder):
  255 + os.makedirs(folder)
254 256 USER_RAYCASTING_PRESETS_DIRECTORY = folder
255 257 RAYCASTING_TYPES += [filename.split(".")[0] for filename in
256 258 os.listdir(folder) if
... ... @@ -350,16 +352,11 @@ SLICE_STATE_SCROLL = 1007
350 352 SLICE_STATE_EDITOR = 1008
351 353  
352 354  
353   -#STATE_DEFAULT = wx.NewId()
354   -
355 355 TOOL_STATES = [ STATE_WL, STATE_SPIN, STATE_ZOOM,
356   - STATE_ZOOM_SL, STATE_PAN] #=\
357   -# [wx.NewId() for number in range(5)]
  356 + STATE_ZOOM_SL, STATE_PAN]
358 357  
359   -TOOL_SLICE_STATES = [SLICE_STATE_CROSS, SLICE_STATE_SCROLL]# =\
360   -# [wx.NewId() for number in range(2)]
  358 +TOOL_SLICE_STATES = [SLICE_STATE_CROSS, SLICE_STATE_SCROLL]
361 359  
362   -#SLICE_STATE_EDITOR = wx.NewId()
363 360  
364 361 SLICE_STYLES = TOOL_STATES + TOOL_SLICE_STATES
365 362 SLICE_STYLES.append(STATE_DEFAULT)
... ...