Commit 5fd506ac71668a2ec500f0165e0db77b310d72e7

Authored by tatiana
1 parent cccd4f7f

FIX: InVesalius is creating .invesalius/presets folders

Showing 1 changed file with 13 additions and 4 deletions   Show diff stats
invesalius/invesalius.py
... ... @@ -17,9 +17,18 @@
17 17 # detalhes.
18 18 #--------------------------------------------------------------------------
19 19  
  20 +from optparse import OptionParser
  21 +import os
20 22 import sys
21 23  
22   -from optparse import OptionParser
  24 +# TODO: This should be called during installation
  25 +# ----------------------------------------------------------------------
  26 +path = os.path.join(os.getenv("HOME"), ".invesalius", "presets")
  27 +try:
  28 + os.makedirs(path)
  29 +except OSError:
  30 + print "Warning: Directory (probably) exists"
  31 +# ----------------------------------------------------------------------
23 32  
24 33 import wx
25 34 import wx.lib.pubsub as ps
... ... @@ -67,15 +76,15 @@ def parse_comand_line():
67 76 else:
68 77 print "Hey, guy you must pass a directory to me!"
69 78  
  79 +def print_events(data):
  80 + print data.topic
  81 +
70 82 def main():
71 83 application = InVesalius(0)
72 84 parse_comand_line()
73 85 application.ShowFrame()
74 86 application.MainLoop()
75 87  
76   -def print_events(data):
77   - print data.topic
78   -
79 88 if __name__ == '__main__':
80 89 # Add current directory to PYTHONPATH
81 90 sys.path.append(".")
... ...