5 self.__dict__.setdefault(
'nodeid',0)
6 self.__dict__.setdefault(
'nodelabel',
'ROOT')
7 self.__dict__.setdefault(
'lft',0)
8 self.__dict__.setdefault(
'rgt',0)
9 self.__dict__.setdefault(
'parentid',0)
10 self.__dict__.setdefault(
'globalsince',0)
11 self.__dict__.setdefault(
'globaltill',0)
12 self.__dict__.setdefault(
'tagid',0)
16 return self.__dict__.__repr__()
18 if not name
in self.__dict__:
19 raise AttributeError(
"Unknown attribute "+name)
20 self.__dict__[name]=value
22 if not name
in self.__dict__:
23 raise AttributeError(
"Unknown attribute "+name)
24 return self.__dict__[name]
26 if self.__dict__[
'nodelabel']==
'':
37 self.__dict__.setdefault(
'tagname',
'')
39 self.__dict__.setdefault(
'pfn',
'')
40 self.__dict__.setdefault(
'recordname',
'')
41 self.__dict__.setdefault(
'objectname',
'')
42 self.__dict__.setdefault(
'labelname',
'')
48 return self.__dict__.__repr__()
49 if __name__ ==
"__main__":
57 except AttributeError:
58 print 'caught right exception'
60 print 'unexpected error'
63 print leaf.__class__.__name__,
'isLeaf',str(leaf.tagid)
64 print node.__class__.__name__,
'isLeaf',str(node.tagid)