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