[Bio] / ModelEditor / pluginExample.py Repository:
ViewVC logotype

View of /ModelEditor/pluginExample.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (download) (as text) (annotate)
Fri Mar 11 21:33:13 2005 UTC (13 years, 7 months ago) by efrank
Branch: MAIN
CVS Tags: before-dynamics-persistence, lwc, treatman-lastDay-0, preTreatmanDyn, HEAD
Changes since 1.4: +5 -48 lines
1. introduce Model as king of the hill rather than RecoElem.
2. migrations to follow
3. new modules for by-peg filtering
4. first stab at externalized app fwk
5. moved seed data factory

bunch of timing code still in this ...need to take out

################################################################################
# Model Editor Plug-in example
#
# See KahModules/Printer.py and KahModules/ModuleTemplate for better examples.
# This file no longer kept up to date.
#
# HISTORY:
#    28 May 04 efrank   First version
#    ?? Jul 04 efrank   Change to class based
#    16 Feb 05 efrank   redirect reader to other places
#
#
################################################################################

from KahOM.RecoElem           import RecoElem
from KahOM.Model              import Model
from KahApp.KahModule         import KahModule


#------------------------------------------------------------------------
def registerHook( register ):
#------------------------------------------------------------------------
    register( "Print Reactions", 
              "Prints Reactions",
              RxPrinter( "RxPrinter") )

    return

#------------------------------------------------------------------------
class RxPrinter( KahModule ):
#------------------------------------------------------------------------
    #------------------------------------------------------------------------
    def __init__( self, name ):
    #------------------------------------------------------------------------
        KahModule.__init__( self, name )


    #------------------------------------------------------------------------
    def process(self, aModel theRecoElem, cfg ):
    #------------------------------------------------------------------------
        """
        Sample plug-in example.  Gathers all the reactions and prints them
        as strings.
        """

        print theRecoElem.getName()
        rxns = []
        theRecoElem.gatherReactions( rxns )

        for r in rxns:
            print r.asString()

        return


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3