objdictgen/objdictedit.py
changeset 276 eada6c6c2e87
parent 273 58b39f97e352
child 280 d9b232ec7057
equal deleted inserted replaced
275:7d5130f2f8ab 276:eada6c6c2e87
   103 
   103 
   104     Html_Window = True
   104     Html_Window = True
   105 except:
   105 except:
   106     Html_Window = False
   106     Html_Window = False
   107 
   107 
   108 def create(parent):
       
   109     return objdictedit(parent)
       
   110 
       
   111 def usage():
       
   112     print "\nUsage of objdictedit.py :"
       
   113     print "\n   %s [Filepath, ...]\n"%sys.argv[0]
       
   114 
       
   115 try:
       
   116     opts, args = getopt.getopt(sys.argv[1:], "h", ["help"])
       
   117 except getopt.GetoptError:
       
   118     # print help information and exit:
       
   119     usage()
       
   120     sys.exit(2)
       
   121 
       
   122 for o, a in opts:
       
   123     if o in ("-h", "--help"):
       
   124         usage()
       
   125         sys.exit()
       
   126 
       
   127 filesOpen = args
       
   128 ScriptDirectory = os.path.split(__file__)[0]
   108 ScriptDirectory = os.path.split(__file__)[0]
   129 
       
   130 
   109 
   131 [ID_OBJDICTEDIT, ID_OBJDICTEDITFILEOPENED, 
   110 [ID_OBJDICTEDIT, ID_OBJDICTEDITFILEOPENED, 
   132  ID_OBJDICTEDITHELPBAR,
   111  ID_OBJDICTEDITHELPBAR,
   133 ] = [wx.NewId() for _init_ctrls in range(3)]
   112 ] = [wx.NewId() for _init_ctrls in range(3)]
   134 
   113 
   316         self.HelpBar = wx.StatusBar(id=ID_OBJDICTEDITHELPBAR, name='HelpBar',
   295         self.HelpBar = wx.StatusBar(id=ID_OBJDICTEDITHELPBAR, name='HelpBar',
   317               parent=self, style=wx.ST_SIZEGRIP)
   296               parent=self, style=wx.ST_SIZEGRIP)
   318         self._init_coll_HelpBar_Fields(self.HelpBar)
   297         self._init_coll_HelpBar_Fields(self.HelpBar)
   319         self.SetStatusBar(self.HelpBar)
   298         self.SetStatusBar(self.HelpBar)
   320 
   299 
   321     def __init__(self, parent):
   300     def __init__(self, parent, filesOpen = []):
   322         self._init_ctrls(parent)
   301         self._init_ctrls(parent)
   323         self.HtmlFrameOpened = []
   302         self.HtmlFrameOpened = []
   324         self.ModeSolo = True
   303         self.ModeSolo = True
   325         
   304         
   326         self.Manager = NodeManager()
   305         self.Manager = NodeManager()
  1007 
   986 
  1008     #sys.excepthook = lambda *args: wx.CallAfter(handle_exception, *args)
   987     #sys.excepthook = lambda *args: wx.CallAfter(handle_exception, *args)
  1009     sys.excepthook = handle_exception
   988     sys.excepthook = handle_exception
  1010 
   989 
  1011 if __name__ == '__main__':
   990 if __name__ == '__main__':
       
   991     def usage():
       
   992         print "\nUsage of objdictedit.py :"
       
   993         print "\n   %s [Filepath, ...]\n"%sys.argv[0]
       
   994 
       
   995     try:
       
   996         opts, args = getopt.getopt(sys.argv[1:], "h", ["help"])
       
   997     except getopt.GetoptError:
       
   998         # print help information and exit:
       
   999         usage()
       
  1000         sys.exit(2)
       
  1001 
       
  1002     for o, a in opts:
       
  1003         if o in ("-h", "--help"):
       
  1004             usage()
       
  1005             sys.exit()
       
  1006     
  1012     app = wx.PySimpleApp()
  1007     app = wx.PySimpleApp()
  1013     wx.InitAllImageHandlers()
  1008     wx.InitAllImageHandlers()
  1014     
  1009     
  1015     # Install a exception handle for bug reports
  1010     # Install a exception handle for bug reports
  1016     AddExceptHook(os.getcwd(),__version__)
  1011     AddExceptHook(os.getcwd(),__version__)
  1017     
  1012     
  1018     frame = objdictedit(None)
  1013     frame = objdictedit(None, args)
  1019 
  1014 
  1020     frame.Show()
  1015     frame.Show()
  1021     app.MainLoop()
  1016     app.MainLoop()