5 import copy, string, types, os
7 from inspect
import isclass
10 VERBOSE, DEBUG, INFO, WARNING, ERROR, FATAL
16 __all__ = [
'Configurable',
17 'ConfigurableAlgorithm',
18 'ConfigurableAlgTool',
19 'ConfigurableAuditor',
20 'ConfigurableService',
22 'VERBOSE',
'DEBUG',
'INFO',
'WARNING',
'ERROR',
'FATAL',
23 'appendPostConfigAction',
'removePostConfigAction' ]
27 log = logging.getLogger(
'Configurable' )
31 Expand environment variables "data".
32 Data can be string, list, tuple and dictionary. For collection, all the
33 contained strings will be manipulated (recursively).
38 return os.path.expandvars(data)
39 elif typ
in [list, tuple]:
53 Error occurred in the configuration process.
58 class PropertyReference(object):
62 return "@%s"%self.
name
66 refname, refprop = self.name.rsplit(
'.',1)
67 if refname
in Configurable.allConfigurables:
68 conf = Configurable.allConfigurables[refname]
69 retval = getattr(conf,refprop)
70 if hasattr(retval,
"getFullName"):
71 retval = retval.getFullName()
73 raise NameError(
"name '%s' not found resolving '%s'"%(refname,self))
76 """This function allow transparent integration with
77 Configurable.getValuedProperties.
84 except AttributeError:
90 """Base class for Gaudi components that implement the IProperty interface.
91 Provides most of the boilerplate code, but the actual useful classes
92 are its derived ConfigurableAlgorithm, ConfigurableService, and
93 ConfigurableAlgTool."""
99 propertyNoValue =
'<no value>'
115 allConfigurables = {}
116 configurableServices = {}
119 _configurationLocked =
False
122 """To Gaudi, any object with the same type/name is the same object. Hence,
123 this is mimicked in the configuration: instantiating a new Configurable
124 of a type with the same name will return the same instance."""
130 name = kwargs[
'name' ]
131 elif 'name' in cls.__init__.func_code.co_varnames:
133 index = list(cls.__init__.func_code.co_varnames).index(
'name' )
136 name = args[ index - 1 ]
139 name = cls.__init__.func_defaults[ index - (len(args)+1) ]
144 except (IndexError,TypeError):
145 raise TypeError(
'no "name" argument while instantiating "%s"' % cls.__name__ )
149 if hasattr(cls,
'DefaultedName' ) :
150 name = cls.DefaultedName
153 elif not name
or type(name) != str:
155 raise TypeError(
'could not retrieve name from %s.__init__ arguments' % cls.__name__ )
159 if issubclass( cls, ConfigurableAlgTool)
and '.' not in name :
160 name =
'ToolSvc.' + name
170 if name
in cls.configurables:
171 conf = cls.configurables[ name ]
173 cls.configurables[ conf.getType() ] = conf
175 for n,v
in kwargs.items():
178 if not cls._configurationLocked
and not "_enabled" in kwargs
and isinstance(conf, ConfigurableUser):
181 setattr(conf,
"_enabled",
True)
185 spos = name.find(
'/' )
188 ti_name =
"%s/%s" % (name,name)
189 if ti_name
in cls.configurables:
191 return cls.configurables[ ti_name ]
196 if i_name == name[spos+1:]
and i_name
in cls.configurables:
198 return cls.configurables[ i_name ]
201 conf = cls.allConfigurables.get( name,
None )
or\
202 (spos < 0
and cls.allConfigurables.get( ti_name,
None ))
or\
203 (spos > 0
and i_name == name[spos+1:]
and cls.allConfigurables.get( i_name,
None ))
205 if conf.__class__
is ConfigurableGeneric :
209 newconf = object.__new__( cls )
210 cls.__init__( newconf, *args, **kwargs )
215 for n
in newconf.__slots__:
217 for n
in conf._properties:
218 if names[n.lower()] != n:
219 log.warning(
"Option '%s' was used for %s, but the correct spelling is '%s'"%(n,name,names[n.lower()]) )
220 setattr(newconf, names[n.lower()], getattr( conf, n ) )
221 for n,v
in kwargs.items():
222 setattr(newconf, n, v)
223 cls.configurables[ name ] = newconf
224 cls.allConfigurables[ name ] = newconf
228 log.error(
'attempt to redefine type of "%s" (was: %s, new: %s)%s',
229 name, conf.__class__.__name__, cls.__name__, error_explanation )
234 for n,v
in kwargs.items():
239 conf = object.__new__(cls)
240 cls.__init__( conf, *args, **kwargs )
243 cls.configurables[ name ] = conf
245 for base
in cls.__bases__:
246 if base.__name__ ==
'ConfigurableService':
247 cls.configurableServices[ name ] = conf
250 cls.allConfigurables[ name ] = conf
258 klass = self.__class__
261 if klass == Configurable:
262 raise TypeError,
"%s is an ABC and can not be instantiated" % str(Configurable)
266 meths = {
'getDlls' : 1,
271 for meth, nArgs
in meths.items():
273 f = getattr( klass, meth ).im_func
274 except AttributeError:
275 raise NotImplementedError,
"%s is missing in class %s" % (meth,str(klass))
278 nargcount = f.func_code.co_argcount
279 ndefaults = f.func_defaults
and len(f.func_defaults)
or 0
280 if not nargcount - ndefaults <= nArgs <= nargcount:
281 raise TypeError,
"%s.%s requires exactly %d arguments" % (klass,meth,nArgs)
289 if hasattr(self.__class__,
'DefaultedName' ) :
290 self.
_name = self.__class__.DefaultedName
308 for name, proxy
in self._properties.items():
310 dict[ name ] = proxy.__get__( self )
311 except AttributeError:
314 dict[
'_Configurable__children' ] = self.
__children
315 dict[
'_Configurable__tools' ] = self.
__tools
316 dict[
'_name' ] = self.
_name
324 for n, v
in dict.items():
337 newconf = object.__new__( self.__class__ )
338 self.__class__.__init__( newconf, self.
getName() )
340 for proxy
in self._properties.values():
342 proxy.__set__( newconf, proxy.__get__( self ) )
343 except AttributeError:
353 if not type(configs)
in (list,tuple):
354 configs = ( configs, )
360 if not isinstance( cfg, Configurable ):
361 raise TypeError(
"'%s' is not a Configurable" % str(cfg) )
366 ccjo = cc.getJobOptName()
368 if c.getJobOptName() == ccjo:
369 log.error(
'attempt to add a duplicate ... dupe ignored%s', error_explanation )
372 self.__children.append( cc )
376 descr.__set__( self, cc )
378 setattr( self, cc.getName(), cc )
379 except AttributeError:
388 if attr
in self._properties:
389 if isinstance(self._properties[attr].__get__( self ), DataObjectHandleBase):
390 return self._properties[attr].__get__( self )
393 if c.getName() == attr:
396 raise AttributeError(
"'%s' object has no attribute '%s'" % (self.__class__,attr) )
400 raise RuntimeError(
"%s: Configuration cannot be modified after the ApplicationMgr has been started."%self.
name())
402 super( Configurable, self ).
__setattr__( name, value )
403 except AttributeError:
404 raise AttributeError(
"Configurable '%s' does not have property '%s'."
405 % ( self.__class__.__name__, name) )
411 prop = self._properties[ attr ]
412 prop.__delete__( self )
413 prop.__set__( self, prop.default )
423 if c.getName() == attr:
424 self.__children.remove( c )
428 del self.__dict__[ attr ]
429 except (AttributeError,KeyError):
437 if type(items) != list
and type(items) != tuple:
447 return copy.deepcopy( child )
461 if hasattr( cc,
'setParent' )
and parent:
463 cc.setParent( parent )
464 except RuntimeError, e:
466 log.error( str(e) +
'%s', error_explanation )
467 ccbd = cc.configurables[ cc.getJobOptName() ]
470 for proxy
in self._properties.values():
471 if proxy.history.has_key( cc ):
472 proxy.__set__( ccbd, proxy.__get__( cc ) )
482 return self.__tools.values()
485 log.error(
"children() is deprecated, use getChildren() instead for consistency" )
486 log.error(
"getChildren() returns a copy; to add a child, use 'parent += child'%s",
491 """Get all (private) configurable children, both explicit ones (added with +=)
492 and the ones in the private GaudiHandle properties"""
495 for proxy
in self._properties.values():
497 c = proxy.__get__( self )
498 except AttributeError:
501 if isinstance(c,Configurable)
and not c.isPublic():
503 elif isinstance(c,GaudiHandle):
505 conf = c.configurable
506 except AttributeError:
509 if not conf.isPublic():
511 elif isinstance(c,GaudiHandleArray):
515 if isinstance(ci,Configurable):
519 conf = ci.configurable
520 except AttributeError:
532 elems.append( c.getFullName() )
537 if not hasattr(self,
'_initok')
or not self.
_initok:
540 "Configurable.__init__ not called in %s override" % self.__class__.__name__
554 handle = self.getHandle()
556 log.debug(
'no handle for %s: not transporting properties', self.
_name )
560 for name
in self._properties.keys():
561 if hasattr( self, name ):
562 setattr( handle, name, getattr(self,name) )
569 for name, proxy
in self._properties.items():
571 props[ name ] = proxy.__get__( self )
572 except AttributeError:
573 props[ name ] = Configurable.propertyNoValue
578 """Get all properties with their description string as { name : (value, desc) }."""
580 for name, proxy
in self._properties.items():
582 props[ name ] = ( proxy.__get__( self ), proxy.__doc__)
583 except AttributeError:
584 props[ name ] = ( Configurable.propertyNoValue, proxy.__doc__)
589 for name, proxy
in self._properties.items():
591 value = proxy.__get__( self )
592 if hasattr(value,
'getFullName') :
593 value = value.getFullName()
594 elif type(value)
in [list, tuple]:
597 if hasattr(i,
'getFullName'):
598 new_value.append(i.getFullName())
601 value =
type(value)(new_value)
602 elif type(value)
is dict:
605 if hasattr(value[i],
'getFullName'):
608 new_value[i] = value[i]
610 props[ name ] = value
627 for k,v
in cls._properties.items():
628 if not k
in c.__dict__
and hasattr( v,
'default' ):
629 c.__dict__[ k ] = v.default
642 if name
in c.__dict__:
643 return c.__dict__[ name ]
647 v = cls._properties[name]
648 if hasattr( v,
'default' ):
656 """Returns the value of the given property.
658 if hasattr(self, name):
659 return getattr(self, name)
664 """Set the value of a given property
666 return setattr(self, name, value)
669 """Tell if the property 'name' has been set or not.
671 Because of a problem with list and dictionary properties, in those cases
672 if the value is equal to the default, the property is considered as not
675 if not hasattr(self, name):
679 if isinstance(default, (list, dict)):
680 value = getattr(self, name)
681 return value != default
701 log.error(
"jobOptName() is deprecated, use getJobOptName() instead for consistency%s",
715 if log.isEnabledFor( logging.DEBUG ):
723 def clone( self, name = None, **kwargs ) :
725 if hasattr(self,
'DefaultedName' ) : name = self.DefaultedName
726 else : name = self.getType()
728 newconf = Configurable.__new__( self.__class__, name )
729 self.__class__.__init__( newconf, name )
731 for proxy
in self._properties.values():
733 value = proxy.__get__( self )
734 if type(value)
in [ str, list, dict, tuple ]:
736 value =
type(value)(value)
737 proxy.__set__( newconf, value )
738 except AttributeError:
741 for c
in self.__children:
744 for n , t
in self.__tools.items():
745 newconf.addTool(t, n)
747 for name, value
in kwargs.items():
748 setattr(newconf, name, value)
754 dot = fullname.find(
'.')
756 parentname = fullname[:dot]
757 longname = fullname[dot+1:]
761 dot = longname.find(
'.')
763 name = longname[:dot]
766 return parentname, name, longname
769 if isclass(tool)
and issubclass(tool, ConfigurableAlgTool):
772 priv_tool = tool( self.
getName()+
'.' + name )
773 elif isinstance(tool, ConfigurableAlgTool):
775 name = tool.splitName()[1]
776 priv_tool = tool.clone( self.
getName()+
'.' + name )
779 classname = tool.__name__
781 classname =
type(tool).__name__
782 raise TypeError,
"addTool requires AlgTool configurable. Got %s type" % classname
786 setattr(self,name,self.
__tools[name])
801 handle = __main__.Service( svc )
806 if hasattr( self,
'configure' + svc ):
807 eval(
'self.configure' + svc +
'( handle )' )
810 dlls = self.getDlls()
813 elif type(dlls) == types.StringType:
816 from __main__
import theApp
817 dlls = filter(
lambda d: d
not in theApp.Dlls, dlls )
818 if dlls: theApp.Dlls += dlls
829 preLen = Configurable.printHeaderPre
830 postLen = Configurable.printHeaderWidth - preLen - 3 - len(title)
831 postLen = max(preLen,postLen)
832 return indentStr +
'/%s %s %s' % (preLen*
'*',title,postLen*
'*')
836 preLen = Configurable.printHeaderPre
837 postLen = Configurable.printHeaderWidth - preLen - 12 - len(title)
838 postLen = max(preLen,postLen)
839 return indentStr +
'\\%s (End of %s) %s' % (preLen*
'-',title,postLen*
'-')
844 def __str__( self, indent = 0, headerLastIndentUnit=indentUnit ):
846 indentStr = indent*Configurable.indentUnit
851 headerIndent = (indent-1)*Configurable.indentUnit + headerLastIndentUnit
854 rep = Configurable._printHeader( headerIndent, title )
860 rep += indentStr +
'|-<no properties>' + os.linesep
864 for p
in props.keys():
865 nameWidth=max(nameWidth,len(p))
866 for p, v
in props.items():
868 prefix = indentStr +
'|-%-*s' % (nameWidth,p)
870 if log.isEnabledFor( logging.DEBUG ):
871 if v != Configurable.propertyNoValue:
872 address =
' @%11s' % hex(id(v))
877 default = defs.get(p)
878 if v == Configurable.propertyNoValue:
880 strVal = repr(default)
884 if hasattr(v,
"getGaudiHandle"):
885 vv = v.getGaudiHandle()
888 if isinstance(vv,GaudiHandle)
or isinstance(vv,GaudiHandleArray):
890 if hasattr(default,
"toStringProperty"):
891 strDef = repr(default.toStringProperty())
893 strDef = repr(default)
894 if strDef == repr(vv.toStringProperty()):
898 strDef = repr(default)
900 line = prefix +
' = ' + strVal
902 if strDef
is not None:
904 if len(line) + len(strDef) > Configurable.printHeaderWidth:
905 line += os.linesep + indentStr +
'| ' + (len(prefix)-len(indentStr)-3)*
' '
906 line +=
' (default: %s)' % (strDef,)
908 rep += line + os.linesep
920 rep += cfg.__str__( indent + 1,
'|=' ) + os.linesep
923 rep += Configurable._printFooter( indentStr, title )
928 Return True is the instance can be "applied".
929 Always False for plain Configurable instances
930 (i.e. not ConfigurableUser).
940 return getattr( obj, self.
__name__ )
943 object.__setattr__( obj, self.
__name__, value )
948 def __init__( self, name = Configurable.DefaultName ):
949 Configurable.__init__( self, name )
957 def getDlls( self ) :
pass
963 super( ConfigurableGeneric, self ).
__setattr__( name, value )
967 if isinstance( value, Configurable ):
968 self.__dict__[ name ] = value
980 class ConfigurableAlgorithm( Configurable ):
981 __slots__ = {
'_jobOptName' : 0,
'OutputLevel' : 0, \
982 'Enable' : 1,
'ErrorMax' : 1,
'ErrorCount' : 0,
'AuditAlgorithms' : 0, \
983 'AuditInitialize' : 0,
'AuditReinitialize' : 0,
'AuditExecute' : 0, \
984 'AuditFinalize' : 0,
'AuditBeginRun' : 0,
'AuditEndRun' : 0 }
986 def __init__( self, name = Configurable.DefaultName ):
987 super( ConfigurableAlgorithm, self ).
__init__( name )
1005 __slots__ = {
'OutputLevel' : 0, \
1006 'AuditServices' : 0,
'AuditInitialize' : 0,
'AuditFinalize' : 0 }
1015 return iService( self.
_name )
1029 __slots__ = {
'_jobOptName' :
'',
'OutputLevel' : 0, \
1030 'AuditTools' : 0,
'AuditInitialize' : 0,
'AuditFinalize' : 0 }
1033 super( ConfigurableAlgTool, self ).
__init__( name )
1034 if '.' not in self.
_name:
1038 name = name[ name.find(
'/')+1 : ]
1059 return pop + Configurable.getPrintTitle(self)
1068 if isinstance(c,ConfigurableAlgTool): c.setParent( parentName )
1072 name = name[name.rfind(
'.')+1:]
1076 dot = self._jobOptName.rfind(
'.')
1083 return self._jobOptName.startswith( parent +
'.' )
1092 return self._jobOptName.startswith(
'ToolSvc.')
1103 name = name[name.rfind(
'.')+1:]
1104 return str( self.
getType() +
'/' + name )
1111 __slots__ = {
'_jobOptName' : 0,
'OutputLevel' : 0, \
1115 super( ConfigurableAuditor, self ).
__init__( name )
1117 name = name[ name.find(
'/')+1 : ]
1135 __slots__ = {
"__users__": [],
1136 "__used_instances__": [],
1147 __used_configurables__ = []
1150 __queried_configurables__ = []
1151 def __init__( self, name = Configurable.DefaultName, _enabled = True, **kwargs ):
1152 super( ConfigurableUser, self ).
__init__( name )
1153 for n, v
in kwargs.items():
1171 if type(used)
is tuple:
1172 used, used_name = used
1176 if type(used)
is str:
1177 used_class = confDbGetConfigurable(used)
1182 inst = used_class(name = used_name, _enabled =
False)
1183 except AttributeError:
1187 inst = used_class(name = used_name)
1191 if type(queried)
is str:
1192 queried = confDbGetConfigurable(used)
1193 inst = queried(_enabled =
False)
1194 except AttributeError:
1199 Declare that we are going to modify the Configurable 'other' in our
1200 __apply_configuration__.
1202 self.__used_instances__.append(other)
1203 if hasattr(other,
"__users__"):
1204 other.__users__.append(self)
1207 Declare that we are going to retrieve property values from the
1208 ConfigurableUser 'other' in our __apply_configuration__.
1210 if not isinstance(other, ConfigurableUser):
1211 raise Error(
"'%s': Cannot make passive use of '%s', it is not a ConfigurableUser" % (self.
name(), other.name()))
1212 other.__addActiveUseOf(self)
1222 Remove this ConfigurableUser instance from the users list of the used
1226 if hasattr(used,
"__users__"):
1227 used.__users__.remove(self)
1231 Propagate the property 'name' (if set) to other configurables (if possible).
1234 propagate to all the entries in __used_configurables__
1235 a configurable instance:
1236 propagate only to it
1237 list of configurable instances:
1238 propagate to all of them.
1242 - if the local property is set, the other property will be overwritten
1243 - local property not set and other set => keep other
1244 - local property not set and other not set => overwrite the default for
1245 ConfigurableUser instances and set the property for Configurables
1250 elif type(others)
not in [ list, tuple ] :
1256 for other
in [ o
for o
in others
if name
in o.__slots__ ]:
1259 if other.isPropertySet(name):
1260 log.warning(
"Property '%(prop)s' is set in both '%(self)s' and '%(other)s', using '%(self)s.%(prop)s'"%
1261 {
"self": self.
name(),
1262 "other": other.name(),
1264 other.setProp(name, value)
1266 elif not other.isPropertySet(name):
1267 if isinstance(other,ConfigurableUser):
1268 otherType =
type(other._properties[name].getDefault())
1269 other._properties[name].setDefault(value)
1270 if otherType
in [list, dict]:
1273 other.setProp(name, otherType(value))
1275 other.setProp(name, value)
1280 Call propagateProperty for each property listed in 'names'.
1281 If 'names' is None, all the properties are propagated.
1285 names = [ p
for p
in self.
__slots__ if not p.startswith(
"_") ]
1291 Function to be overridden to convert the high level configuration into a
1293 The default implementation calls applyConf, which is the method defined
1294 in some ConfigurableUser implementations.
1300 Function to be overridden to convert the high level configuration into a
1307 Function used to define the name of the private instance of a given class
1309 This method is used when the __used_configurables_property__ declares the
1310 need of a private used configurable without specifying the name.
1312 if type(cls)
is str:
1315 clName = cls.__name__
1316 return "%s_%s" % (self.name(), clName)
1320 Return the used instance with a given name.
1323 if i.name() == name:
1324 if hasattr(i,
"_enabled"):
1329 raise KeyError(name)
1333 Return True is the instance can be "applied".
1339 postConfigActions = []
1342 Add a new callable ('function') to the list of post-configuration actions.
1343 If the callable is already in the list, it is moved to the end of the list.
1344 The list is directly accessible as 'GaudiKernel.Configurable.postConfigActions'.
1347 postConfigActions.remove(function)
1350 postConfigActions.append(function)
1353 Remove a callable from the list of post-config actions.
1354 The list is directly accessible as 'GaudiKernel.Configurable.postConfigActions'.
1356 postConfigActions.remove(function)
1358 _appliedConfigurableUsers_ =
False
1361 Call the apply method of all the ConfigurableUser instances respecting the
1362 dependencies. First the C.U.s that are not used by anybody, then the used
1363 ones, when they are not used anymore.
1366 global _appliedConfigurableUsers_, postConfigActions
1367 if _appliedConfigurableUsers_:
1369 _appliedConfigurableUsers_ =
True
1371 def applicableConfUsers():
1373 Generator returning all the configurables that can be applied in the
1374 order in which they can be applied.
1386 yield (c
for c
in Configurable.allConfigurables.values()
1387 if c.isApplicable()).next()
1389 debugApplyOrder =
'GAUDI_DUBUG_CONF_USER' in os.environ
1390 for c
in applicableConfUsers():
1392 log.info(
"applying configuration of %s", c.name())
1394 sys.stderr.write(
'applying %r' % c)
1395 c.__apply_configuration__()
1398 log.info(
"skipping configuration of %s", c.name())
1400 if hasattr(c,
"__detach_used__"):
1405 leftConfUsers = [c
for c
in Configurable.allConfigurables.values()
1406 if hasattr(c,
'__apply_configuration__')
and
1407 c._enabled
and not c._applied]
1410 raise Error(
"Detected loop in the ConfigurableUser"
1411 " dependencies: %r" % [ c.name()
1412 for c
in leftConfUsers ])
1415 unknown = set(Configurable.allConfigurables)
1419 log.debug(
'new configurable created automatically: %s', k)
1421 Configurable.allConfigurables[k].
properties()
1425 for action
in postConfigActions:
1430 Obsolete (buggy) implementation of applyConfigurableUsers(), kept to provide
1431 backward compatibility for configurations that where relying (implicitly) on
1432 bug #103803, or on a specific (non guaranteed) order of execution.
1434 @see applyConfigurableUsers()
1437 global _appliedConfigurableUsers_, postConfigActions
1438 if _appliedConfigurableUsers_:
1440 _appliedConfigurableUsers_ =
True
1442 debugApplyOrder =
'GAUDI_DUBUG_CONF_USER' in os.environ
1444 for c
in Configurable.allConfigurables.values()
1445 if hasattr(c,
"__apply_configuration__") ]
1447 while applied
and confUsers:
1451 if hasattr(c,
"__users__")
and c.__users__:
1452 newConfUsers.append(c)
1457 enabled = (
not hasattr(c,
"_enabled"))
or c._enabled
1459 log.info(
"applying configuration of %s", c.name())
1461 sys.stderr.write(
'applying %r' % c)
1462 c.__apply_configuration__()
1465 log.info(
"skipping configuration of %s", c.name())
1466 if hasattr(c,
"__detach_used__"):
1469 confUsers = newConfUsers
1472 raise Error(
"Detected loop in the ConfigurableUser "
1473 " dependencies: %r" % [ c.name()
1474 for c
in confUsers ])
1477 unknown = set(Configurable.allConfigurables)
1481 log.debug(
'new configurable created automatically: %s', k)
1483 Configurable.allConfigurables[k].
properties()
1487 for action
in postConfigActions:
1492 Function to select all and only the configurables that have to be used in
1493 GaudiPython.AppMgr constructor.
1494 This is needed because in Athena the implementation have to be different (the
1495 configuration is used in a different moment).
1498 for k, v
in Configurable.allConfigurables.items()
1499 if v.getGaudiType() !=
"User" ]
1503 Clean up all configurations and configurables.
1505 for c
in Configurable.allConfigurables.values():
1506 c.__class__.configurables.clear()
1507 Configurable.allConfigurables.clear()
1510 ConfigurableGeneric.configurables.clear()
1511 from ProcessJobOptions
import _included_files
1513 for file
in _included_files:
1514 dirname, basname = os.path.split(file)
1515 basname, ext = os.path.splitext(basname)
1516 if basname
in sys.modules:
1517 del sys.modules[basname]
1518 _included_files.clear()
def getNeededConfigurables()
def __deepcopy__(self, memo)
def setParent(self, parentName)
def __apply_configuration__(self)
def __deepcopy__(self, memo)
def __detach_used__(self)
def __setstate__(self, dict)
list __queried_configurables__
list of ConfigurableUser classes this one is going to query in the apply_configuration method ...
def _printHeader(indentStr, title)
def __init__(self, name=Configurable.DefaultName, _enabled=True, kwargs)
def __addPassiveUseOf(self, other)
def __new__(cls, args, kwargs)
def hasParent(self, parent)
def appendPostConfigAction(function)
def getPropertiesWithDescription(self)
def __setupDefaults(self)
def _printFooter(indentStr, title)
def applyConfigurableUsers()
def clone(self, name=None, kwargs)
def _instanceName(self, cls)
def setProp(self, name, value)
list __used_configurables__
list of ConfigurableUser classes this one is going to modify in the apply_configuration method...
def __deepcopy__(self, memo)
def __getattr__(self, attr)
def __init__(self, propname)
def __deepcopy__(self, memo)
def copyChildAndSetParent(self, cfg, parent)
def __setattr__(self, name, value)
def __addActiveUseOf(self, other)
def setDefaults(cls, handle)
def isPropertySet(self, name)
def toStringProperty(self)
def getDefaultProperties(cls)
def __delattr__(self, attr)
def getUsedInstance(self, name)
def copyChild(self, child)
def applyConfigurableUsers_old()
iAlgorithm
The basic module.
def getFullJobOptName(self)
def __set__(self, obj, value)
def removePostConfigAction(function)
def __setupServices(self)
classes for generic Gaudi component ===========
def _isInSetDefaults(self)
def getDefaultProperty(cls, name)
def toStringProperty(self)
def copyChild(self, child)
def getValuedProperties(self)
def __setattr__(self, name, value)
def isApplicable(self)
if isinstance(v,Configurable) and not v.isPublic(): rep += v.__str__( indent + 1 ) + os...
for detecting the default name