[Bio] / ModelEditor / ModelEditor Repository:
ViewVC logotype

Diff of /ModelEditor/ModelEditor

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5, Mon Nov 8 00:34:17 2004 UTC revision 1.11, Fri Apr 22 15:14:03 2005 UTC
# Line 1  Line 1 
1  #!/usr/bin/env python  #!/bin/sh
2    
3  #import signal  # On some systems you must use pythonw to invoke wx apps and on others
4  from wxPython.wx import *  # you don't.  Hide that via this script.
5    
 from ModelEditor.MainLayout        import MainLayout  
 from ModelEditor.RXpanel           import RXPanel  
 from ModelEditor.RecoElempanel     import RecoElempanel  
 from ModelEditor.Catalogpanel      import Catalogpanel  
 from ModelEditor.MetabolitePanel   import MetabolitePanel  
 from ModelEditor.EnzymeWindow      import EnzymeWindow  
 from ModelEditor.HelpPanel         import HelpPanel  
 from ModelEditor.FontManager       import FontManager  
 from ModelEditor.MainMenuBar       import MainMenuBar  
 from FaST.BssFactory         import BssFactory  
 from CatalogServices.Catalog import Catalog  
   
 #need to change panel to Panel. lower case panel is already in cvs.  
   
 from wxPython.grid import *  
   
   
 class MyApp(wxApp):  
     def OnInit(self):  
         frame = Gui(None, -1, "test")  
         frame.Show()  
         return 1  
   
   
 class Gui(MainLayout):  
   
     def __init__(self, *args, **kwds):  
   
         #self.factoryMgr = None  
         MainLayout.__init__(self, *args, **kwds)  
   
         self.rootId        = None        # root ID for recoelem tree.  why here??  
         self.catalogRootId = None        # root ID for catalog tree.  
         self.fontManager    = FontManager(self)  
         self.mainMenuBar    = MainMenuBar(self)  
         self.rx             = RXPanel(self)  
         self.re             = RecoElempanel(self)  
         self.cat            = Catalogpanel(self)  
         self.met            = MetabolitePanel(self)  
         self.enzyme         = EnzymeWindow(self)  
         self.help           = HelpPanel(self)  
         self.meAGMgr        = None       #MeAGMgr instance to manage ag issues  
   
         EVT_CLOSE(self, self.mainMenuBar.exitApp)  
   
         #signal.signal(signal.SIGINT, self.signalHandler)  
         #signal.signal(signal.SIGTERM, self.signalHandler)  
         #signal.signal(signal.SIGHUP, self.signalHandler)  
   
         try:  
             #b = BssFactory('biosimscratch/bss@db02', 'oracle' )  
             #b = BssFactory('pgsql.mcs.anl.gov:5432:kahdb:trust:inme', "postgres")  
             #b = BssFactory('porta-video:5432:KahSCDb:trust:inme', "postgres")  
             #b = BssFactory('fl-gentoo-test:5432:KahSCDb:trust:inme', "postgres")  
             b = BssFactory('140.221.204.254:5432:KahSCDb:trust:inme', "postgres")  
             Catalog.instance().addDataFactory( b)  
         except NotImplementedError:  
             pass  
   
         return  
   
     def error( self, message):  
         dlg = wxMessageDialog(self, message, style=wxOK)  
         dlg.ShowModal()  
         dlg.Destroy()  
         return  
   
     #------------------------------------------------------------------------  
     def signalHandler(self, signum, frame):  
     #------------------------------------------------------------------------  
         """  
         signal handler for sigint, sigterm, and sigHUP to let us close down cleanly.  
         We need to disconnect from AG.  
         """  
   
         print "ModelEditor:signalHandler: caught signal=", signum  
   
         try:  
             theMgr = self.cat.meAGMgr  
             if (not theMgr == None):  
                 theMgr.done()  
         except Exception, e:  
             print e  
   
         self.mainMenuBar.exitApp(None)  
         return  
   
   
 ########################################################################  
 if __name__ == "__main__":  
     app = MyApp(0)  
     app.MainLoop()  
6    
7    if [ .${RTARCH} = .mac ]; then
8    
9        # on mac, must use system python and distributed wxPython.  have
10        # not been able to build succesfully ourselves.  but in Seed envrionment,
11        # python must be rebuilt to get bob's callPerl to work.  So in Seed
12        # environment, paths etc., are setup to use Seeds own build of py,
13        # which breaks wxPy which breaks the ModelEditor (but not Kah in total)
14        # So, in Seed env, there's a separate install of our external dependencies
15        # and there's an executable, mac_wx_workaround, that points to that
16        # area.  By modifying python path with that, we can call the system
17        # python to  launch wxPy applications.  Do that dance here:
18    
19        if [ -f $RTROOT/env/mac/bin/mac_wx_workaround ]; then
20           a=`mac_wx_workaround`
21           set $a
22           sysPyDir=$1
23           sysPyLib=$2
24           echo Using mac wxPy workaround via $sysPyLib
25    
26           export PYTHONPATH=${sysPyLib}:$PYTHONPATH
27        fi
28    
29        pythonw `which ModelEditorExe`
30    else
31        python `which ModelEditorExe`
32    fi

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.11

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3