13 """ GaudiPython.Bindings module.
14 This module provides the basic bindings of the main Gaudi
15 components to Python. It is itself based on the ROOT cppyy
16 Python extension module.
18 from __future__
import absolute_import, print_function
52 from GaudiKernel
import ROOT6WorkAroundEnabled
55 with warnings.catch_warnings():
56 warnings.simplefilter(
"ignore")
59 if sys.version_info >= (3,):
71 from GaudiKernel.Proxy.Configurable
import Configurable, getNeededConfigurables
73 from .
import Pythonizations
82 gbl.gInterpreter.Declare(
'#include "Gaudi/Property.h"')
83 Helper = gbl.GaudiPython.Helper
84 StringProperty = gbl.Gaudi.Property(
"std::string")
85 StringPropertyRef = gbl.Gaudi.Property(
"std::string&")
86 GaudiHandleProperty = gbl.GaudiHandleProperty
87 GaudiHandleArrayProperty = gbl.GaudiHandleArrayProperty
88 DataObject = gbl.DataObject
89 SUCCESS = gbl.StatusCode(gbl.StatusCode.SUCCESS)
90 FAILURE = gbl.StatusCode(gbl.StatusCode.FAILURE)
92 if hasattr(cppyy,
"nullptr"):
93 nullptr = cppyy.nullptr
94 elif hasattr(gbl,
"nullptr"):
99 cppyy.gbl.gInterpreter.Declare(
102 namespace GaudiPython { namespace Helpers {
103 void setProperty(ISvcLocator* svcLoc, std::string key, std::string value) {
104 if ( !svcLoc ) throw std::runtime_error( "invalid ISvcLocator pointer" );
105 svcLoc->getOptsSvc().set(key, value);
112 for l
in [l
for l
in dir(Helper)
if re.match(
"^to.*Array$", l)]:
113 exec(
"%s = Helper.%s" % (l, l))
117 if hasattr(Helper,
"toArray"):
121 return getattr(Helper,
"toArray")
126 return getattr(Helper,
"toArray<%s>" % typ)
131 if hasattr(cppyy,
"libPyROOT"):
132 ROOT = cppyy.libPyROOT
135 makeNullPointer = ROOT.MakeNullPointer
136 setOwnership = ROOT.SetOwnership
140 warnings.warn(
"GaudiPython: " + message, DeprecationWarning, stacklevel=3)
147 """Helper class to obtain the adequate interface from a component
148 by using the Gaudi queryInterface() mechanism"""
159 if obj.queryInterface(self.
type.interfaceID(), ip).isSuccess():
163 "ERROR: queryInterface failed for", obj,
"interface:", self.
type
165 except Exception
as e:
169 "caught when retrieving interface",
176 traceback.print_stack()
188 InterfaceCast.__init__(self, t)
198 """Load an LCG dictionary"""
199 loadlib_return_code = Helper.loadDynamicLib(dict)
200 if loadlib_return_code == 1:
203 f
"Failed to load dictionary library {dict} (return code {loadlib_return_code})"
212 Function to retrieve a certain C++ class by name and to load dictionary if requested
216 from gaudimodule import getClass
217 # one knows that class is already loaded
218 AppMgr = getClass( 'ApplicationMgr' )
219 # one knows where to look for class, if not loaded yet
220 MCParticle = getClass( 'MCParticle' , 'EventDict' )
221 # one knows where to look for class, if not loaded yet
222 Vertex = getClass( 'Vertex' , ['EventDict', 'PhysEventDict'] )
225 if hasattr(gbl, name):
226 return getattr(gbl, name)
228 if type(libs)
is not list:
232 if hasattr(gbl, name):
233 return getattr(gbl, name)
242 """holds the value and the documentation string of a property"""
248 if issubclass(
type(prop), GaudiHandleProperty):
250 elif issubclass(
type(prop), GaudiHandleArrayProperty):
251 self.
_value = prop.value()
255 self.
_value = eval(prop.toString(), {}, {})
257 if hasattr(prop,
"value"):
258 self.
_value = prop.value()
260 self.
_value = prop.toString()
262 self.
__doc__ +=
" --- Default value = " + str(self.
_value) +
" --- "
263 if prop.documentation() !=
"none":
275 "Return the underlying property itself"
289 """Python equivalent to the C++ Property interface"""
293 self.__dict__[
"_svcloc"] = gbl.Gaudi.svcLocator()
294 self.__dict__[
"_name"] = name
305 if not getattr(self, ifname):
306 self.retrieveInterface()
307 return getattr(getattr(self, ifname), method)(*args)
311 The method which is used for setting the property from the given value.
312 - In the case of the valid instance it sets the property through IProperty interface
313 - In the case of placeholder the property is added to JobOptionsCatalogue
315 if hasattr(value,
"toStringProperty"):
317 value = str(value.toStringProperty())
318 elif hasattr(value,
"toString"):
319 value = str(value.toString())
320 elif type(value) == long:
327 if not gbl.Gaudi.Utils.hasProperty(ip, name):
328 raise AttributeError(
"property %s does not exist" % name)
329 ip.setPropertyRepr(name, value)
331 gbl.GaudiPython.Helpers.setProperty(
332 self._svcloc,
".".join([self._name, name]), value
337 The method which returns the value for the given property
338 - In the case of the valid instance it returns the valid property value through IProperty interface
339 - In the case of placeholder the property value is retrieved from JobOptionsCatalogue
343 if not gbl.Gaudi.Utils.hasProperty(ip, name):
344 raise AttributeError(
"property %s does not exist" % name)
345 prop = ip.getProperty(name)
346 if StringProperty ==
type(prop):
348 elif StringPropertyRef ==
type(prop):
351 return eval(prop.toString(), {}, {})
355 opts = self._svcloc.getOptsSvc()
356 if opts.has(
"{}.{}".
format(self._name, name)):
358 return eval(opts.get(
"{}.{}".
format(self._name, name)), {}, {})
359 raise AttributeError(
"property %s does not exist" % name)
366 props = ip.getProperties()
367 propsFrom = self._name
369 raise NotImplementedError(
"rely on IJobOptionsSvc")
370 props = self._optsvc.getProperties(self._name)
371 propsFrom =
"jobOptionsSvc"
376 except (ValueError, TypeError)
as e:
378 "gaudimodule.iProperty.properties(): %s%s processing property %s.%s = %s"
379 % (e.__class__.__name__, e.args, propsFrom, p.name(), p.value())
391 """Python equivalent to IProperty interface"""
394 iProperty.__init__(self, name, isvc)
398 isvc = Helper.service(self._svcloc, self._name)
400 iService.__init__(self, self._name, isvc)
431 """Python equivalent to IAlgorithm interface"""
434 iProperty.__init__(self, name, ialg)
438 ialg = Helper.algorithm(
442 iAlgorithm.__init__(self, self._name, ialg)
491 """Python equivalent to IAlgTool interface (not completed yet)"""
494 iProperty.__init__(self, name, itool)
495 self.__dict__[
"_itool"] = itool
496 svc = Helper.service(self._svcloc,
"ToolSvc",
True)
497 self.__dict__[
"_toolsvc"] =
iToolSvc(
"ToolSvc", svc)
500 itool = self._toolsvc._retrieve(self._name)
502 iAlgTool.__init__(self, self._name, itool)
515 return self._itool.
name()
525 iService.__init__(self, name, idp)
526 self.__dict__[
"_idp"] =
InterfaceCast(gbl.IDataProviderSvc)(idp)
527 self.__dict__[
"_idm"] =
InterfaceCast(gbl.IDataManagerSvc)(idp)
531 raise AttributeError(
532 "C++ service %s does not exist" % self.__dict__[
"_name"]
534 return Helper.registerObject(self._idp, path, obj)
538 raise AttributeError(
539 "C++ service %s does not exist" % self.__dict__[
"_name"]
541 return Helper.unregisterObject(self._idp, path)
546 return Helper.dataobject(self._idp, path)
553 Get the existing object in TransientStore for the given location
555 - loading of object from persistency is NOT triggered
556 - 'data-on-demand' action is NOT triggered
558 >>> svc = ... ## get the service
559 >>> path = ... ## get the path in Transient Store
560 >>> data = svc.findObject ( path ) ## use the method
564 raise IndexError(
"C++ service %s does not exist" % self.__dict__[
"_name"])
565 return Helper.findobject(self._idp, path)
570 Get object from Transient Store for the given location
573 - path : Location of object in Transient Store
574 - retrieve (bool) True : retrieve versus find
575 - disable on-demand (bool) False : temporary disable 'on-demand' actions
577 >>> svc = ... ## get the service
578 >>> path = ... ## get the path
580 >>> data = svc.getObject ( path , False ) ## find object in Transient Store
582 ## find object in Transient Store
583 # load form tape or use 'on-demand' action for missing objects :
584 >>> data = svc.getObject ( path , True )
586 ## find object in Transient Store
587 # load from tape or for missing objects, disable 'on-demand'-actions
588 >>> data = svc.getObject ( path , True , True )
592 raise IndexError(
"C++ service %s does not exist" % self.__dict__[
"_name"])
593 return Helper.getobject(self._idp, path, *args)
597 raise IndexError(
"C++ service %s does not exist" % self.__dict__[
"_name"])
598 return Helper.dataobject(self._idp, path)
602 raise IndexError(
"C++ service %s does not exist" % self.__dict__[
"_name"])
607 raise IndexError(
"C++ service %s does not exist" % self.__dict__[
"_name"])
611 if node == cppyy.nullptr:
613 ll = gbl.std.vector(
"IRegistry*")()
614 if type(node)
is str:
618 if self._idm.objectLeaves(node, ll).isSuccess():
621 def dump(self, node=cppyy.nullptr):
622 if node == cppyy.nullptr:
625 node = root.registry()
628 print(node.identifier())
630 for l
in self.
leaves(node):
633 def getList(self, node=cppyy.nullptr, lst=[], rootFID=None):
634 if node == cppyy.nullptr:
637 node = root.registry()
638 rootFID = node.address().
par()
642 Helper.dataobject(self._idp, node.identifier())
644 lst.append(node.identifier())
645 for l
in self.
leaves(node):
646 if l.address()
and l.address().
par() == rootFID:
653 if node == cppyy.nullptr:
656 node = root.registry()
661 Helper.dataobject(self._idp, node.identifier())
663 lst.append(node.identifier())
664 for l
in self.
leaves(node):
673 raise IndexError(
"C++ service %s does not exist" % self.__dict__[
"_name"])
674 return self._idm.
setRoot(name, obj)
678 raise IndexError(
"C++ service %s does not exist" % self.__dict__[
"_name"])
685 self.__dict__[
"_ihs"] =
InterfaceCast(gbl.IHistogramSvc)(ihs)
686 iDataSvc.__init__(self, name, ihs)
689 return Helper.histo1D(self._ihs, path)
692 return Helper.histo2D(self._ihs, path)
695 return Helper.histo3D(self._ihs, path)
698 return Helper.profile1D(self._ihs, path)
701 return Helper.profile2D(self._ihs, path)
705 Retrieve AIDA histogram or AIDA profile histogram by path in Histogram Transient Store
707 >>> histo = svc.retrieve ( 'path/to/my/histogram' )
722 Book the histograms(1D,2D&3D) , see IHistogramSvc::book
724 >>> histo = svc.book( .... )
726 return self._ihs.
book(*args)
730 Book the profile(1D&2D) histograms, see IHistogramSvc::bookProf
732 >>> histo = svc.bookProf( .... )
738 Retrieve the object from Histogram Transient Store (by path)
739 The reference to AIDA histogram is returned (if possible)
741 >>> histo = svc['path/to/my/histogram']
746 return iDataSvc.__getitem__(self, path)
750 Retrieve the histogram from Histogram Transient Store (by path)
751 The reference to AIDA histogram is returned (if possible)
753 >>> histo = svc.getAsAIDA ( 'path/to/my/histogram' )
759 Retrieve the histogram from Histogram Transient Store (by path)
760 The Underlying native ROOT object is returned (if possible)
762 >>> histo = svc.getAsROOT ( 'path/to/my/histogram' )
764 fun = gbl.Gaudi.Utils.Aida2ROOT.aida2root
777 iDataSvc.__init__(self, name, ints)
780 return self._ints.
book(*args)
783 """Defines the mapping between logical names and the output file
785 defineOutput({'LUN1':'MyFile1.root', 'LUN2':'Myfile2.root'}, svc='Gaudi::RootCnvSvc')
787 from .
import Persistency
as prs
789 helper = prs.get(typ)
790 helper.configure(
AppMgr())
791 self.
Output = [helper.formatOutput(files[lun], lun=lun)
for lun
in files]
792 if AppMgr().HistogramPersistency ==
"NONE":
793 AppMgr().HistogramPersistency =
"ROOT"
796 return iDataSvc.__getitem__(self, path)
803 iService.__init__(self, name, its)
806 sol = _gaudi.OutputLevel
809 if name.rfind(
".") == -1:
810 itool = Helper.tool(self._its,
"", name, nullptr,
False)
811 elif name[0:8] ==
"ToolSvc.":
812 itool = Helper.tool(self._its,
"", name[8:], nullptr,
False)
813 elif name.count(
".") > 1:
814 ptool = self.
_retrieve(name[: name.rfind(
".")])
816 self._its,
"", name[name.rfind(
".") + 1 :], ptool,
False
819 prop = _gaudi.property(name[: name.rfind(
".")])
821 self._its,
"", name[name.rfind(
".") + 1 :], prop._ip,
False
830 def create(self, typ, name=None, parent=nullptr, interface=None):
833 itool = Helper.tool(self._its, typ, name, parent,
True)
840 if type(itool)
is iAlgTool:
841 self._its.releaseTool(itool._itool)
852 Helper.service(gbl.Gaudi.svcLocator(),
"EventSelector"),
854 self.__dict__[
"g"] =
AppMgr()
856 def open(self, stream, typ="Gaudi::RootCnvSvc
", **kwargs):
857 from .
import Persistency
as prs
859 helper = prs.get(typ)
860 helper.configure(self.g)
861 self.
Input = helper.formatInput(stream, **kwargs)
876 newobj = object.__new__(cls)
877 cls.
__init__(newobj, *args, **kwargs)
909 self.__dict__[
"_exit_called"] =
False
911 self.__dict__[
"_gaudi_ns"] = Gaudi
913 from GaudiKernel.Proxy.Configurable
import expandvars
919 if dllname
and factname:
920 self.__dict__[
"_appmgr"] = gbl.Gaudi.createApplicationMgr(dllname, factname)
922 self.__dict__[
"_appmgr"] = gbl.Gaudi.createApplicationMgr(dllname)
924 self.__dict__[
"_appmgr"] = gbl.Gaudi.createApplicationMgr()
925 self.__dict__[
"_svcloc"] = gbl.Gaudi.svcLocator()
927 self.__dict__[
"_evtpro"] =
InterfaceCast(gbl.IEventProcessor)(self._appmgr)
928 self.__dict__[
"_svcmgr"] =
InterfaceCast(gbl.ISvcManager)(self._appmgr)
929 self.__dict__[
"pyalgorithms"] = []
930 iService.__init__(self,
"ApplicationMgr", self._appmgr)
932 if self.
FSMState() < Gaudi.StateMachine.CONFIGURED:
939 import GaudiKernel.Proxy.Configurable
941 if hasattr(GaudiKernel.Proxy.Configurable,
"applyConfigurableUsers"):
942 GaudiKernel.Proxy.Configurable.applyConfigurableUsers()
946 appMgr = Configurable.allConfigurables[
"ApplicationMgr"]
947 selfprops =
expandvars(appMgr.getValuedProperties())
950 for p, v
in selfprops.items():
952 for p, v
in selfoptions.items():
955 if outputlevel != -1:
959 ms = self.
service(
"MessageSvc")
960 if "MessageSvc" in Configurable.allConfigurables:
961 msprops = Configurable.allConfigurables[
"MessageSvc"]
962 ms = self.
service(
"MessageSvc")
963 if hasattr(msprops,
"getValuedProperties"):
964 msprops =
expandvars(msprops.getValuedProperties())
965 for p, v
in msprops.items():
967 if outputlevel != -1:
968 ms.OutputLevel = outputlevel
971 c = Configurable.allConfigurables[n]
972 if n
in [
"ApplicationMgr",
"MessageSvc"]:
974 for p, v
in c.getValuedProperties().
items():
978 hasattr(Configurable,
"PropertyReference")
979 and type(v) == Configurable.PropertyReference
988 gbl.GaudiPython.Helpers.setProperty(
989 self._svcloc,
".".join([n, p]), str(v)
991 if hasattr(Configurable,
"_configurationLocked"):
992 Configurable._configurationLocked =
True
997 atexit.register(self.
exit)
1003 orig_register = atexit.register
1005 def register(func, *targs, **kargs):
1006 orig_register(func, *targs, **kargs)
1007 if hasattr(func,
"__module__")
and func.__module__ ==
"ROOT":
1008 orig_register(self.
exit)
1012 register.__doc__ = (
1013 orig_register.__doc__
1014 +
"\nNote: version hacked by GaudiPython to work "
1015 +
"around a problem with the ROOT exit handler"
1017 atexit.register = register
1021 if "_svcloc" in self.__dict__:
1022 return self._svcloc.getOptsSvc()
1035 svc = Helper.service(self._svcloc, name)
1042 self._svcmgr.declareSvcType(svcname, svctype)
1045 return Helper.service(self._svcloc, name,
True)
1048 l = self._svcloc.getServices()
1049 return [s.name()
for s
in l]
1052 alg = Helper.algorithm(self._algmgr, name, createIf)
1059 l = self._algmgr.getAlgorithms()
1060 return [a.name()
for a
in l]
1074 if self.
state() == Gaudi.StateMachine.CONFIGURED:
1076 svc = Helper.service(self._svcloc, name)
1080 return self.
datasvc(
"EventDataSvc")
1083 return self.
datasvc(
"DetectorDataSvc")
1086 return self.
datasvc(
"FileRecordDataSvc")
1089 if self.
state() == Gaudi.StateMachine.CONFIGURED:
1091 if not hasattr(self,
"_evtsel"):
1096 svc = Helper.service(self._svcloc, name)
1100 if name
not in self.ExtSvc:
1101 self.ExtSvc += [name]
1103 svc = Helper.service(self._svcloc, name,
True)
1107 if self.
FSMState() == Gaudi.StateMachine.CONFIGURED:
1109 svc = Helper.service(self._svcloc,
"ParticlePropertySvc")
1113 svc = Helper.service(self._svcloc, name,
True)
1120 """Add an Algorithm to the list of Top algorithms. It can be either a instance of
1121 an Algorithm class or it name"""
1122 if type(alg)
is str:
1125 self.pyalgorithms.append(alg)
1131 self.
topAlg += [alg.name()]
1134 """Set the list of Top Algorithms.
1135 It can be an individual of a list of algorithms names or instances"""
1136 if type(algs)
is not list:
1140 if type(alg)
is str:
1143 self.pyalgorithms.append(alg)
1148 names.append(alg.name())
1152 """Remove an Algorithm to the list of Top algorithms. It can be either a instance of
1153 an Algorithm class or it name"""
1155 if type(alg)
is str:
1158 tmp.remove(alg.name())
1159 self.pyalgorithms.remove(alg)
1165 Print the sequence of Algorithms.
1168 def printAlgo(algName, appMgr, prefix=" "):
1169 print(prefix + algName)
1170 alg = appMgr.algorithm(algName.split(
"/")[-1])
1171 prop = alg.properties()
1172 if "Members" in prop:
1173 subs = prop[
"Members"].value()
1175 printAlgo(i.strip(
'"'), appMgr, prefix +
" ")
1178 prefix =
"ApplicationMgr SUCCESS "
1181 +
"****************************** Algorithm Sequence ****************************"
1183 for i
in mp[
"TopAlg"].value():
1184 printAlgo(i, self, prefix)
1187 +
"******************************************************************************"
1192 Simple utility to perform the configuration of Gaudi application.
1193 It reads the set of input job-options files, and set few
1194 additional parameters 'options' through the usage of temporary *.opts file
1196 gaudi.config( files = [ '$GAUSSOPTS/Gauss.opts' ,
1197 '$DECFILESROOT/options/10022_010.0GeV.opts' ] ,
1198 options = [ 'EventSelector.PrintFreq = 5 ' ] )
1200 files = args.get(
"files", [])
1204 raise RuntimeError(
' Unable to read file "' + file +
'" ')
1205 options = args.get(
"options",
None)
1209 tmpfilename = tempfile.mktemp()
1210 tmpfile = open(tmpfilename,
"w")
1211 tmpfile.write(
"#pragma print on \n")
1213 '/// File "' + tmpfilename +
'" generated by GaudiPython \n\n'
1216 if type(options)
is dict:
1222 +
" ; // added by GaudiPython \n"
1225 tmpfile.write(
" \t " + opt +
" ; // added by GaudiPython \n")
1227 '/// End of file "' + tmpfilename +
'" generated by GaudiPython \n\n'
1232 raise RuntimeError(
' Unable to read file "' + tmpfilename +
'" ')
1233 os.remove(tmpfilename)
1241 return self._appmgr.
start()
1247 if self.
FSMState() == Gaudi.StateMachine.CONFIGURED:
1249 if sc.isFailure()
or self.ReturnCode != 0:
1251 if self.
FSMState() == Gaudi.StateMachine.INITIALIZED:
1253 if sc.isFailure()
or self.ReturnCode != 0:
1255 return self._evtpro.executeRun(n)
1264 if self.
FSMState() == Gaudi.StateMachine.CONFIGURED:
1268 if self.
FSMState() == Gaudi.StateMachine.INITIALIZED:
1273 if not hasattr(self,
"_perssvc"):
1274 self.__dict__[
"_perssvc"] = self.
service(
1275 "EventPersistencySvc",
"IAddressCreator"
1277 if not hasattr(self,
"_filecat"):
1278 self.__dict__[
"_filecat"] = self.
service(
1279 "FileCatalog",
"Gaudi::IFileCatalog"
1281 if not hasattr(self,
"_evtmgr"):
1282 self.__dict__[
"_evtmgr"] = self.
service(
"EventDataSvc",
"IDataManagerSvc")
1284 if pfn.find(
"PFN:") == 0:
1288 if not self._filecat.existsFID(fid):
1289 self._filecat.registerPFN(fid, pfn,
"")
1291 if type(events)
is not list:
1295 gadd = gbl.GenericAddress(0x02, 1, fid,
"/Event", 0, evt)
1297 self._perssvc.createAddress(
1298 gadd.svcType(), gadd.clID(), gadd.par(), gadd.ipar(), oadd
1301 self._evtmgr.clearStore()
1302 self._evtmgr.setRoot(
"/Event", oadd)
1307 if not self._exit_called:
1308 self.__dict__[
"_exit_called"] =
True
1309 Gaudi = self._gaudi_ns
1310 if self.
FSMState() == Gaudi.StateMachine.RUNNING:
1311 self._appmgr.
stop().ignore()
1312 if self.
FSMState() == Gaudi.StateMachine.INITIALIZED:
1314 if self.
FSMState() == Gaudi.StateMachine.CONFIGURED:
1325 ntupleSvc = ntuplesvc
1336 tfile = gbl.TFile.Open(pfn)
1338 raise IOError(
"Cannot open ROOT file {0}".
format(pfn))
1339 tree = tfile.Get(
"##Params")
1341 text = tree.db_string
1342 if "NAME=FID" in text:
1343 fid = text[text.rfind(
"VALUE=") + 6 : -1]
1344 nevt = tfile.Get(
"_Event").GetEntries()
1353 """Get all the properties of a component as a Python dictionary.
1354 The component is instantiated using the component library
1357 if name ==
"GaudiCoreSvc":
1358 if Helper.loadDynamicLib(name) != 1:
1359 raise ImportError(
"Error loading component library " + name)
1360 factorylist = gbl.FactoryTable.instance().getEntries()
1362 g =
AppMgr(outputlevel=7)
1364 g =
AppMgr(outputlevel=7)
1365 if Helper.loadDynamicLib(name) != 1:
1366 raise ImportError(
"Error loading component library " + name)
1367 factorylist = gbl.FactoryTable.instance().getEntries()
1369 svcloc = gbl.Gaudi.svcLocator()
1370 dummysvc = gbl.Service(
"DummySvc", svcloc)
1371 for factory
in factories:
1378 elif factory.ident() ==
"ApplicationMgr":
1379 ctype =
"ApplicationMgr"
1382 cname = factory.ident().split()[-1]
1383 if ctype
in (
"Algorithm",
"Service",
"AlgTool",
"ApplicationMgr"):
1385 if ctype ==
"AlgTool":
1386 obj = factory.instantiate(dummysvc)
1388 obj = factory.instantiate(svcloc)
1389 except RuntimeError
as text:
1390 print(
"Error instantiating", cname,
" from ", name)
1394 properties[cname] = [ctype, prop.properties()]
1404 for i
in range(factories.size()):
1405 factory = factories.front()
1406 result.append(factory)
1407 factories.pop_front()
1408 for factory
in result:
1409 factories.push_back(factory)
1415 _CallbackStreamBufBase = gbl.GaudiPython.CallbackStreamBuf
1420 _CallbackStreamBufBase.__init__(self, self)
1432 _PyAlgorithm = gbl.GaudiPython.PyAlgorithm
1438 name = self.__class__.__name__
1439 _PyAlgorithm.__init__(self, self, name)
1442 sc = self.
_algmgr.addAlgorithm(self)
1444 raise RuntimeError(
"Unable to add Algorithm")
1447 sc = self.
_algmgr.removeAlgorithm(self)
1472 readline.parse_and_bind(
"tab: complete")