From 9f47af2795176f132dd2922aa4fe9ad46c274cf4 Mon Sep 17 00:00:00 2001 From: tatiana Date: Wed, 6 Jan 2010 16:34:00 +0000 Subject: [PATCH] FIX: #83 (when directory .invesalius doesn't exist) --- invesalius/constants.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/invesalius/constants.py b/invesalius/constants.py index b1daa81..ca77a7b 100644 --- a/invesalius/constants.py +++ b/invesalius/constants.py @@ -246,11 +246,13 @@ TYPE_RAYCASTING_MAPPER = 1 folder=RAYCASTING_PRESETS_DIRECTORY= os.path.abspath(os.path.join("..", "presets", "raycasting")) - RAYCASTING_TYPES = [filename.split(".")[0] for filename in os.listdir(folder) if os.path.isfile(os.path.join(folder,filename))] + folder = os.path.join(os.path.expanduser('~'), '.invesalius', 'presets') +if not os.path.isdir(folder): + os.makedirs(folder) USER_RAYCASTING_PRESETS_DIRECTORY = folder RAYCASTING_TYPES += [filename.split(".")[0] for filename in os.listdir(folder) if @@ -350,16 +352,11 @@ SLICE_STATE_SCROLL = 1007 SLICE_STATE_EDITOR = 1008 -#STATE_DEFAULT = wx.NewId() - TOOL_STATES = [ STATE_WL, STATE_SPIN, STATE_ZOOM, - STATE_ZOOM_SL, STATE_PAN] #=\ -# [wx.NewId() for number in range(5)] + STATE_ZOOM_SL, STATE_PAN] -TOOL_SLICE_STATES = [SLICE_STATE_CROSS, SLICE_STATE_SCROLL]# =\ -# [wx.NewId() for number in range(2)] +TOOL_SLICE_STATES = [SLICE_STATE_CROSS, SLICE_STATE_SCROLL] -#SLICE_STATE_EDITOR = wx.NewId() SLICE_STYLES = TOOL_STATES + TOOL_SLICE_STATES SLICE_STYLES.append(STATE_DEFAULT) -- libgit2 0.21.2