From 5fd506ac71668a2ec500f0165e0db77b310d72e7 Mon Sep 17 00:00:00 2001 From: tatiana Date: Fri, 2 Oct 2009 13:52:14 +0000 Subject: [PATCH] FIX: InVesalius is creating .invesalius/presets folders --- invesalius/invesalius.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/invesalius/invesalius.py b/invesalius/invesalius.py index 3f94741..5aa44ec 100755 --- a/invesalius/invesalius.py +++ b/invesalius/invesalius.py @@ -17,9 +17,18 @@ # detalhes. #-------------------------------------------------------------------------- +from optparse import OptionParser +import os import sys -from optparse import OptionParser +# TODO: This should be called during installation +# ---------------------------------------------------------------------- +path = os.path.join(os.getenv("HOME"), ".invesalius", "presets") +try: + os.makedirs(path) +except OSError: + print "Warning: Directory (probably) exists" +# ---------------------------------------------------------------------- import wx import wx.lib.pubsub as ps @@ -67,15 +76,15 @@ def parse_comand_line(): else: print "Hey, guy you must pass a directory to me!" +def print_events(data): + print data.topic + def main(): application = InVesalius(0) parse_comand_line() application.ShowFrame() application.MainLoop() -def print_events(data): - print data.topic - if __name__ == '__main__': # Add current directory to PYTHONPATH sys.path.append(".") -- libgit2 0.21.2