[Bio] / ModelEditor / ModelEditor Repository:
ViewVC logotype

View of /ModelEditor/ModelEditor

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (download) (annotate)
Thu Nov 4 02:19:59 2004 UTC (14 years, 7 months ago) by efrank
Branch: MAIN
CVS Tags: sc2004-3
Changes since 1.3: +26 -0 lines
cleanAGEntry:		removes stale state from sharedApp

DDL related: 		increased size of varchars for names of chemistry stuff
			to handle big fat seed stuff

SeedDataFactory		turn off mapping of assignments to chemistry.

KahCatAGCfgMgr		remmoveKey() to support cleanAGEntry

StringReaction:		allow multiple : in strings being parsed to handle
			junk from seed with lots of colons.  ONly the final
			is treated as deliminting the end of the enzyme name

ModelEditor		signal handling, but commentd back out.

RXpanel			duh

#!/usr/bin/env python

#import signal
from wxPython.wx import *

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")
            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()     


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3