ATLAS Offline Software
Public Member Functions | Static Public Attributes | List of all members
python.TrigPyHelper.TrigApp Class Reference
Inheritance diagram for python.TrigPyHelper.TrigApp:
Collaboration diagram for python.TrigPyHelper.TrigApp:

Public Member Functions

def service (self, name, iface=gbl.IService)
 
def changeJobProperties (self, clientName, propertyName, newValue)
 

Static Public Attributes

 log = logging.getLogger("TrigApp" )
 

Detailed Description

Helper class to work with Python bindings in athenaMT/PT

Definition at line 14 of file TrigPyHelper.py.

Member Function Documentation

◆ changeJobProperties()

def python.TrigPyHelper.TrigApp.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)

Definition at line 26 of file TrigPyHelper.py.

26  def changeJobProperties(self, clientName, propertyName, newValue):
27  """Change the property of a client to a new value. Both client and property
28  can be a regular expression in which case all properties matching will
29  be changed to the new value. Note, this will only change properties that
30  already exist in the JobOptionsCatalogue.
31  Example: trigApp.changeJobProperties('.*', 'OutputLevel', DEBUG)"""
32 
33  jobOptSvc = InterfaceCast(gbl.Gaudi.Interfaces.IOptionsSvc)(Helper.service(gbl.Gaudi.svcLocator(), "JobOptionsSvc"))
34  if not jobOptSvc:
35  self.log.error("Cannot find JobOptionsSvc")
36  return
37 
38  import re
39  reClient = re.compile(clientName)
40  reProp = re.compile(propertyName)
41 
42 
44  for p in jobOptSvc.items():
45  name = p._0
46  value = p._1
47  client, prop = name.rsplit('.',1)
48  if reClient.match(client) and reProp.match(prop):
49  self.log.info("Changing %s.%s from '%s' to '%s'", client, prop, value, newValue)
50  iprop = iProperty(client)
51  setattr(iprop, prop, newValue)
52 
53  return
54 
55 

◆ service()

def python.TrigPyHelper.TrigApp.service (   self,
  name,
  iface = gbl.IService 
)
Retrieve service with interface iface.
   Example: trigApp.service('MessageSvc',gbl.IMessageSvc)

Definition at line 19 of file TrigPyHelper.py.

19  def service(self, name, iface = gbl.IService):
20  """Retrieve service with interface iface.
21  Example: trigApp.service('MessageSvc',gbl.IMessageSvc)"""
22 
23  svc = InterfaceCast(iface)(Helper.service(gbl.Gaudi.svcLocator(), name))
24  return svc
25 

Member Data Documentation

◆ log

python.TrigPyHelper.TrigApp.log = logging.getLogger("TrigApp" )
static

Definition at line 17 of file TrigPyHelper.py.


The documentation for this class was generated from the following file:
grepfile.info
info
Definition: grepfile.py:38
error
Definition: IImpactPoint3dEstimator.h:70