ATLAS Offline Software
Public Member Functions | Public Attributes | Properties | Private Attributes | List of all members
python.PropertyProxy.DataHandlePropertyProxy Class Reference
Inheritance diagram for python.PropertyProxy.DataHandlePropertyProxy:
Collaboration diagram for python.PropertyProxy.DataHandlePropertyProxy:

Public Member Functions

def __init__ (self, descr, docString, default)
 
def __get__ (self, obj, type=None)
 
def __set__ (self, obj, value)
 
def convertValueToBeSet (self, obj, value)
 
def setDefault (self, value)
 
def getDefault (self)
 
def fullPropertyName (self, obj)
 
def __delete__ (self, obj)
 

Public Attributes

 history
 
 descr
 

Properties

 default = property( getDefault, setDefault )
 

Private Attributes

 __doc__
 
 __default
 

Detailed Description

Definition at line 402 of file PropertyProxy.py.

Constructor & Destructor Documentation

◆ __init__()

def python.PropertyProxy.DataHandlePropertyProxy.__init__ (   self,
  descr,
  docString,
  default 
)

Reimplemented from python.PropertyProxy.PropertyProxy.

Definition at line 403 of file PropertyProxy.py.

403  def __init__(self, descr, docString, default):
404  PropertyProxy.__init__(self, descr, docString, default)
405 

Member Function Documentation

◆ __delete__()

def python.PropertyProxy.PropertyProxy.__delete__ (   self,
  obj 
)
inherited

Definition at line 172 of file PropertyProxy.py.

172  def __delete__( self, obj ):
173  if obj in self.history:
174  del self.history[ obj ]
175  self.descr.__delete__( obj )
176 
177 
178 

◆ __get__()

def python.PropertyProxy.DataHandlePropertyProxy.__get__ (   self,
  obj,
  type = None 
)

Reimplemented from python.PropertyProxy.PropertyProxy.

Definition at line 406 of file PropertyProxy.py.

406  def __get__(self, obj, type=None):
407  try:
408  return self.descr.__get__(obj, type)
409  except AttributeError:
410  # Get default
411  try:
412  default = obj.__class__.getDefaultProperty(self.descr.__name__)
413  default = self.convertValueToBeSet(obj, default)
414  if default:
415  self.__set__(obj, default)
416  except AttributeError as e:
417  # change type of exception to avoid false error message
418  raise RuntimeError(*e.args)
419 
420  return self.descr.__get__(obj, type)
421 

◆ __set__()

def python.PropertyProxy.DataHandlePropertyProxy.__set__ (   self,
  obj,
  value 
)

Reimplemented from python.PropertyProxy.PropertyProxy.

Definition at line 422 of file PropertyProxy.py.

422  def __set__(self, obj, value):
423  if not obj._isInSetDefaults() or obj not in self.history:
424  value = self.convertValueToBeSet(obj, value)
425  # assign the value
426  self.descr.__set__(obj, value)
427  log.debug("Setting %s = %r", self.fullPropertyName(obj), value)
428  self.history.setdefault(obj, []).append(value)
429 

◆ convertValueToBeSet()

def python.PropertyProxy.DataHandlePropertyProxy.convertValueToBeSet (   self,
  obj,
  value 
)

Definition at line 430 of file PropertyProxy.py.

430  def convertValueToBeSet(self, obj, value):
431  if value is None:
432  value = ''
433 
434  mode = obj.__class__.getDefaultProperty(self.descr.__name__).mode()
435  _type = obj.__class__.getDefaultProperty(self.descr.__name__).type()
436  if type(value) is str:
437  return DataHandle(value, mode, _type)
438  elif isinstance(value, DataHandle):
439  return DataHandle(value.__str__(), mode, _type)
440  else:
441  raise ValueError("received an instance of %s, but %s expected" %
442  (type(value), 'str or DataHandle'))
443 
444 

◆ fullPropertyName()

def python.PropertyProxy.PropertyProxy.fullPropertyName (   self,
  obj 
)
inherited

Definition at line 93 of file PropertyProxy.py.

93  def fullPropertyName( self, obj ):
94  return (obj.getJobOptName() or obj.getName()) + '.' + self.descr.__name__
95 

◆ getDefault()

def python.PropertyProxy.PropertyProxy.getDefault (   self)
inherited

Definition at line 88 of file PropertyProxy.py.

88  def getDefault( self ):
89  return self.__default
90 

◆ setDefault()

def python.PropertyProxy.PropertyProxy.setDefault (   self,
  value 
)
inherited

Definition at line 85 of file PropertyProxy.py.

85  def setDefault( self, value ):
86  self.__default = value
87 

Member Data Documentation

◆ __default

python.PropertyProxy.PropertyProxy.__default
privateinherited

Definition at line 86 of file PropertyProxy.py.

◆ __doc__

python.PropertyProxy.PropertyProxy.__doc__
privateinherited

Definition at line 81 of file PropertyProxy.py.

◆ descr

python.PropertyProxy.PropertyProxy.descr
inherited

Definition at line 79 of file PropertyProxy.py.

◆ history

python.PropertyProxy.PropertyProxy.history
inherited

Definition at line 78 of file PropertyProxy.py.

Property Documentation

◆ default

python.PropertyProxy.PropertyProxy.default = property( getDefault, setDefault )
staticinherited

Definition at line 91 of file PropertyProxy.py.


The documentation for this class was generated from the following file:
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
Preparation.mode
mode
Definition: Preparation.py:94
DataHandle
an iterator over instances of a given type in StoreGateSvc. It d-casts and caches locally the pointed...
Definition: DataHandle.h:42
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78