From 848b9e313983559afcf6a0e295e34676fb129c0b Mon Sep 17 00:00:00 2001 From: tatiana Date: Thu, 3 Dec 2009 17:24:30 +0000 Subject: [PATCH] FIX: Import dicom from command line --- invesalius/invesalius.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/invesalius/invesalius.py b/invesalius/invesalius.py index 1ade1c9..5e0a354 100755 --- a/invesalius/invesalius.py +++ b/invesalius/invesalius.py @@ -64,8 +64,8 @@ def parse_comand_line(): parser.add_option("-i", "--import", action="store", dest="dicom_dir") options, args = parser.parse_args() - print "ARRRRRGHs", args - + print "opt", options + print "arg", args if options.debug: # The user passed the debug option? @@ -76,7 +76,7 @@ def parse_comand_line(): session = Session() session.debug = 1 - elif options.dicom_dir: + if options.dicom_dir: # The user passed directory to me? import_dir = options.dicom_dir ps.Publisher().sendMessage('Import directory', import_dir) @@ -85,14 +85,15 @@ def parse_comand_line(): # print "Hey, guy, you need to pass a inv3 file to me!" # Check if there is a file path somewhere in what the user wrote - i = len(args) - while i: - i -= 1 - file = args[i] - if os.path.isfile(file): - path = os.path.abspath(file) - ps.Publisher().sendMessage('Open project', path) - i = 0 + else: + i = len(args) + while i: + i -= 1 + file = args[i] + if os.path.isfile(file): + path = os.path.abspath(file) + ps.Publisher().sendMessage('Open project', path) + i = 0 def print_events(data): -- libgit2 0.21.2