objdictgen/objdictedit.py
changeset 276 eada6c6c2e87
parent 273 58b39f97e352
child 280 d9b232ec7057
--- a/objdictgen/objdictedit.py	Tue Sep 18 09:02:38 2007 +0200
+++ b/objdictgen/objdictedit.py	Tue Sep 18 18:04:54 2007 +0200
@@ -105,29 +105,8 @@
 except:
     Html_Window = False
 
-def create(parent):
-    return objdictedit(parent)
-
-def usage():
-    print "\nUsage of objdictedit.py :"
-    print "\n   %s [Filepath, ...]\n"%sys.argv[0]
-
-try:
-    opts, args = getopt.getopt(sys.argv[1:], "h", ["help"])
-except getopt.GetoptError:
-    # print help information and exit:
-    usage()
-    sys.exit(2)
-
-for o, a in opts:
-    if o in ("-h", "--help"):
-        usage()
-        sys.exit()
-
-filesOpen = args
 ScriptDirectory = os.path.split(__file__)[0]
 
-
 [ID_OBJDICTEDIT, ID_OBJDICTEDITFILEOPENED, 
  ID_OBJDICTEDITHELPBAR,
 ] = [wx.NewId() for _init_ctrls in range(3)]
@@ -318,7 +297,7 @@
         self._init_coll_HelpBar_Fields(self.HelpBar)
         self.SetStatusBar(self.HelpBar)
 
-    def __init__(self, parent):
+    def __init__(self, parent, filesOpen = []):
         self._init_ctrls(parent)
         self.HtmlFrameOpened = []
         self.ModeSolo = True
@@ -1009,13 +988,29 @@
     sys.excepthook = handle_exception
 
 if __name__ == '__main__':
+    def usage():
+        print "\nUsage of objdictedit.py :"
+        print "\n   %s [Filepath, ...]\n"%sys.argv[0]
+
+    try:
+        opts, args = getopt.getopt(sys.argv[1:], "h", ["help"])
+    except getopt.GetoptError:
+        # print help information and exit:
+        usage()
+        sys.exit(2)
+
+    for o, a in opts:
+        if o in ("-h", "--help"):
+            usage()
+            sys.exit()
+    
     app = wx.PySimpleApp()
     wx.InitAllImageHandlers()
     
     # Install a exception handle for bug reports
     AddExceptHook(os.getcwd(),__version__)
     
-    frame = objdictedit(None)
+    frame = objdictedit(None, args)
 
     frame.Show()
     app.MainLoop()