| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

PyloWorld.py

Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 '''This module defines some pure-Python algorithms.  
00004 
00005 It can be called via nuwa.py:
00006 
00007   nuwa.py -n XXX -m 'DybHelloWorld.PyloWorld ["my optional message"]'
00008 
00009 '''
00010 
00011 
00012 from GaudiPython.GaudiAlgs import GaudiAlgo
00013 from GaudiPython import SUCCESS, FAILURE
00014 
00015 class SayHello(GaudiAlgo):
00016     '''
00017     A pure-Python class that says a message each execute()
00018     '''
00019 
00020     def __init__(self,myname,message="\nHello World from Python!\n"):
00021         '''Create a SayHello algorithm.  Ass a "message" argument to
00022         customize greating'''
00023 
00024         GaudiAlgo.__init__(self,myname)
00025         self.message = message
00026         return
00027 
00028     def execute(self):
00029         print self.message
00030         return SUCCESS
00031     pass
00032 
00033 
00034 
00035 ### nuwa.py hooks:
00036 
00037 my_message = "\nHello World from Python!\n"
00038 def configure(argv = []):
00039     if len(argv):
00040         global my_message
00041         my_message = argv[0]
00042         print 'Configure with my_message=',my_message
00043     return
00044 
00045 def run(app):
00046     global my_message
00047     print 'Making a SayHello with',my_message
00048     alg = SayHello("Friendly",message=my_message)
00049     app.addAlgorithm(alg)
00050     return
00051 
00052     
00053         
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:09:52 2011 for DybHelloWorld by doxygen 1.4.7