[Bio] / ModelEditor / ModelEditor Repository:
ViewVC logotype

Annotation of /ModelEditor/ModelEditor

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (view) (download)

1 : efrank 1.1 #!/usr/bin/env python
2 :    
3 : efrank 1.4 #import signal
4 : efrank 1.1 from wxPython.wx import *
5 :    
6 :     from ModelEditor.MainLayout import MainLayout
7 :     from ModelEditor.RXpanel import RXPanel
8 :     from ModelEditor.RecoElempanel import RecoElempanel
9 :     from ModelEditor.Catalogpanel import Catalogpanel
10 :     from ModelEditor.MetabolitePanel import MetabolitePanel
11 :     from ModelEditor.EnzymeWindow import EnzymeWindow
12 :     from ModelEditor.HelpPanel import HelpPanel
13 :     from ModelEditor.FontManager import FontManager
14 :     from ModelEditor.MainMenuBar import MainMenuBar
15 :     from FaST.BssFactory import BssFactory
16 :     from CatalogServices.Catalog import Catalog
17 :    
18 :     #need to change panel to Panel. lower case panel is already in cvs.
19 :    
20 :     from wxPython.grid import *
21 :    
22 :    
23 :     class MyApp(wxApp):
24 :     def OnInit(self):
25 :     frame = Gui(None, -1, "test")
26 :     frame.Show()
27 :     return 1
28 :    
29 :    
30 :     class Gui(MainLayout):
31 :    
32 :     def __init__(self, *args, **kwds):
33 :    
34 :     #self.factoryMgr = None
35 :     MainLayout.__init__(self, *args, **kwds)
36 :    
37 :     self.rootId = None # root ID for recoelem tree. why here??
38 :     self.catalogRootId = None # root ID for catalog tree.
39 :     self.fontManager = FontManager(self)
40 :     self.mainMenuBar = MainMenuBar(self)
41 :     self.rx = RXPanel(self)
42 :     self.re = RecoElempanel(self)
43 :     self.cat = Catalogpanel(self)
44 :     self.met = MetabolitePanel(self)
45 :     self.enzyme = EnzymeWindow(self)
46 :     self.help = HelpPanel(self)
47 : efrank 1.2 self.meAGMgr = None #MeAGMgr instance to manage ag issues
48 : efrank 1.1
49 : efrank 1.3 EVT_CLOSE(self, self.mainMenuBar.exitApp)
50 :    
51 : efrank 1.4 #signal.signal(signal.SIGINT, self.signalHandler)
52 :     #signal.signal(signal.SIGTERM, self.signalHandler)
53 :     #signal.signal(signal.SIGHUP, self.signalHandler)
54 :    
55 : efrank 1.1 try:
56 : efrank 1.2 #b = BssFactory('biosimscratch/bss@db02', 'oracle' )
57 : efrank 1.1 #b = BssFactory('pgsql.mcs.anl.gov:5432:kahdb:trust:inme', "postgres")
58 : efrank 1.3 #b = BssFactory('porta-video:5432:KahSCDb:trust:inme', "postgres")
59 :     b = BssFactory('fl-gentoo-test:5432:KahSCDb:trust:inme', "postgres")
60 : efrank 1.1 Catalog.instance().addDataFactory( b)
61 :     except NotImplementedError:
62 :     pass
63 :    
64 :     return
65 :    
66 :     def error( self, message):
67 :     dlg = wxMessageDialog(self, message, style=wxOK)
68 :     dlg.ShowModal()
69 :     dlg.Destroy()
70 :     return
71 :    
72 : efrank 1.4 #------------------------------------------------------------------------
73 :     def signalHandler(self, signum, frame):
74 :     #------------------------------------------------------------------------
75 :     """
76 :     signal handler for sigint, sigterm, and sigHUP to let us close down cleanly.
77 :     We need to disconnect from AG.
78 :     """
79 :    
80 :     print "ModelEditor:signalHandler: caught signal=", signum
81 :    
82 :     try:
83 :     theMgr = self.cat.meAGMgr
84 :     if (not theMgr == None):
85 :     theMgr.done()
86 :     except Exception, e:
87 :     print e
88 :    
89 :     self.mainMenuBar.exitApp(None)
90 :     return
91 :    
92 :    
93 : efrank 1.1 ########################################################################
94 :     if __name__ == "__main__":
95 :     app = MyApp(0)
96 :     app.MainLoop()
97 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3