have to supply argv to main() as a list, splitting on whitespace won't

work if you supply an argument like a path with a space in it.
This commit is contained in:
Matt Turnbull 2009-03-22 14:53:10 +00:00
parent 3f879ddb3d
commit 285c7d8824

View File

@ -210,11 +210,9 @@ class GuiBulkImport():
def main(argv=None): def main(argv=None):
"""main can also be called in the python interpreter, by supplying the command line as the argument. """main can also be called in the python interpreter, by supplying the command line as the argument.
>>>import GuiBulkImport >>>import GuiBulkImport
>>>GuiBulkImport.main("-f ~/data/hands")""" >>>GuiBulkImport.main(['-f'.'~/data/hands'])"""
if argv is None: if argv is None:
argv = sys.argv[1:] argv = sys.argv[1:]
else:
argv = argv.split(" ")
def destroy(*args): # call back for terminating the main eventloop def destroy(*args): # call back for terminating the main eventloop
gtk.main_quit() gtk.main_quit()