The Gaudi Framework  v32r2 (46d42edc)
DataObjectHandleBase.py
Go to the documentation of this file.
1 __doc__ = """The python module holding python bindings to DataObjectHandle"""
2 
3 # s = "/Path/to/Address"
4 
5 
6 class DataObjectHandleBase(object):
7 
8  __slots__ = ('Path', 'Mode', 'Type')
9 
10  # define accessTypes
11 
12  def __init__(self, path, mode='R', _type="unknown_t"):
13  object.__init__(self)
14  self.Path = path
15  self.Mode = mode
16  self.Type = _type
17 
18  def __eq__(self, other):
19  """
20  Need especially Configurable.isPropertySet when checked against default.
21  """
22  if isinstance(other, DataObjectHandleBase):
23  return self.Path == other.Path
24  if isinstance(other, str):
25  return self.Path == other
26  if other is None:
27  return False
28  raise ValueError(
29  'Unknown equality check: type=%r, repr=%r' % (type(other), other))
30 
31  def __ne__(self, other):
32  """
33  This is mandatory if __eq__ is defined.
34  """
35  return not self == other
36 
37  def __str__(self):
38  return self.Path
39 
40  def __repr__(self):
41  return "%s(\"%s\")" % (self.__class__.__name__, self.__str__())
42 
43  def toStringProperty(self):
44  return self.__str__()
45 
46  def __add__(self, other):
47  path = ':'.join(i + other for i in self.Path.split(':'))
48  return DataObjectHandleBase(path, self.Mode, self.Type)
49 
50  def __radd__(self, other):
51  path = ':'.join(other + i for i in self.Path.split(':'))
52  return DataObjectHandleBase(path, self.Mode, self.Type)
53 
54  def __iadd__(self, other):
55  self.Path = ':'.join(i + other for i in self.Path.split(':'))
56  return self
57 
58  def mode(self):
59  return self.Mode
60 
61  def type(self):
62  return self.Type
def __init__(self, path, mode='R', _type="unknown_t")