コード例 #1
0
   def changeJobProperties(self, clientName, propertyName, newValue):
      """Change the property of a client to a new value. Both client and property
         can be a regular expression in which case all properties matching will
         be changed to the new value. Note, this will only change properties that
         already exist in the JobOptionsCatalogue.
         Example: trigApp.changeJobProperties('.*', 'OutputLevel', DEBUG)"""
      
      jobOptSvc = InterfaceCast(gbl.IJobOptionsSvc)(Helper.service(gbl.Gaudi.svcLocator(), "JobOptionsSvc"))
      if not jobOptSvc:
         log.error("Cannot find JobOptionsSvc")
         return

      import re
      reClient = re.compile(clientName)
      reProp = re.compile(propertyName)

      ## Loop over all clients/properties
      for client in jobOptSvc.getClients():
         for prop in jobOptSvc.getProperties(client):      
            if reClient.match(client) and reProp.match(prop.name()):
               self.log.info("Changing %s.%s from '%s' to '%s'" % \
                             (client, prop.name(), prop.value(), newValue))
               iprop = iProperty(client)
               setattr(iprop, prop.name(), newValue)
               
      return
コード例 #2
0
 def service(self, name, iface = gbl.IService):
    """Retrieve service with interface iface.
       Example: trigApp.service('MessageSvc',gbl.IMessageSvc)"""
    
    svc = InterfaceCast(iface)(Helper.service(gbl.Gaudi.svcLocator(), name))
    return svc
コード例 #3
0
try:
   from GaudiPython.Bindings import Helper, gbl
   from GaudiPython.Bindings import InterfaceCast as Interface
except ImportError:
   from gaudimodule import Helper, Interface, gbl


### data ---------------------------------------------------------------------
__version__ = '2.0.0'
__author__  = 'Wim Lavrijsen ([email protected])'

__all__ = [ 'JobOptionsSvc' ]


### Job Options Service ease of use ------------------------------------------
JobOptionsSvc = Helper.service( gbl.Gaudi.svcLocator(), 'JobOptionsSvc' )
JobOptionsSvc = Interface( gbl.IJobOptionsSvc ).cast( JobOptionsSvc )
JobOptionsSvc.__class__.__doc__ = """Gaudi Job Options Service

In normal use, the JobOptionsSvc is one of the earliest services available.
Hence, you can rely on this proxy to have bound to the actual service on the
C++ side.

In addition to the normal JobOptions interface, the python proxy defines the
dump(), clean(), and verify() methods. See below for details."""

def _josvc_dump( self, what = None, out = sys.stdout ):
   """Print a dump of the current catalogue entries of <what> or simply all
entries if no argument is given."""

   if what and not ( type(what) == list or type(what) == tuple ):