[Bio] / ModelEditor / ModelEditor Repository:
ViewVC logotype

Annotation of /ModelEditor/ModelEditor

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (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.6 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 : efrank 1.5 #b = BssFactory('fl-gentoo-test:5432:KahSCDb:trust:inme', "postgres")
60 : efrank 1.6 #b = BssFactory('140.221.204.254:5432:KahSCDb:trust:inme', "postgres")
61 : efrank 1.1 Catalog.instance().addDataFactory( b)
62 :     except NotImplementedError:
63 :     pass
64 :    
65 :     return
66 :    
67 :     def error( self, message):
68 :     dlg = wxMessageDialog(self, message, style=wxOK)
69 :     dlg.ShowModal()
70 :     dlg.Destroy()
71 :     return
72 :    
73 : efrank 1.4 #------------------------------------------------------------------------
74 :     def signalHandler(self, signum, frame):
75 :     #------------------------------------------------------------------------
76 :     """
77 :     signal handler for sigint, sigterm, and sigHUP to let us close down cleanly.
78 :     We need to disconnect from AG.
79 :     """
80 :    
81 :     print "ModelEditor:signalHandler: caught signal=", signum
82 :    
83 :     try:
84 :     theMgr = self.cat.meAGMgr
85 :     if (not theMgr == None):
86 :     theMgr.done()
87 :     except Exception, e:
88 :     print e
89 :    
90 :     self.mainMenuBar.exitApp(None)
91 :     return
92 :    
93 :    
94 : efrank 1.1 ########################################################################
95 :     if __name__ == "__main__":
96 :     app = MyApp(0)
97 :     app.MainLoop()
98 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3