ATLAS Offline Software
Loading...
Searching...
No Matches
PyPoolBrowser.EDMItem Class Reference
Inheritance diagram for PyPoolBrowser.EDMItem:
Collaboration diagram for PyPoolBrowser.EDMItem:

Public Member Functions

 __init__ (self, name, ref, expandable, classKey=None)
 GetText (self)
 IsExpandable (self)
 GetIconName (self)
 OnDoubleClick (self)
 GetSubList (self)

Public Attributes

 name = name
 ref = ref
 expandable = expandable
 classKey = classKey

Detailed Description

Definition at line 15 of file PyPoolBrowser.py.

Constructor & Destructor Documentation

◆ __init__()

PyPoolBrowser.EDMItem.__init__ ( self,
name,
ref,
expandable,
classKey = None )

Definition at line 20 of file PyPoolBrowser.py.

20 def __init__ (self, name, ref, expandable, classKey=None):
21 self.name = name
22 self.ref = ref
23 self.expandable = expandable
24 self.classKey = classKey
25

Member Function Documentation

◆ GetIconName()

PyPoolBrowser.EDMItem.GetIconName ( self)

Definition at line 32 of file PyPoolBrowser.py.

32 def GetIconName(self):
33 if not self.IsExpandable():
34 return "python" # XXX wish there was a "file" icon
35

◆ GetSubList()

PyPoolBrowser.EDMItem.GetSubList ( self)

Reimplemented in PyPoolBrowser.RootItem.

Definition at line 52 of file PyPoolBrowser.py.

52 def GetSubList (self):
53 sublist = []
54 # if a vector-like class
55 if hasattr(self.ref,'size') and hasattr(self.ref,'__getitem__'):
56 # use the fist one
57 if self.ref.size() != 0:
58 item = EDMItem ('%s constituents' % self.ref.size(),self.ref[0],True,self.classKey)
59 sublist.append(item)
60 return sublist
61 #others
62 else:
63 attrs=dir(self.ref)
64 attrs.sort()
65 for attr in attrs:
66 # private
67 if re.search(r"\A_",attr):
68 continue
69 # member
70 if re.search(r"\Am_",attr):
71 continue
72 # method
73 attrRef = getattr(self.ref,attr)
74 item = EDMItem (attr,attrRef,False,self.classKey)
75 sublist.append(item)
76 return sublist
77
78# Root Item

◆ GetText()

PyPoolBrowser.EDMItem.GetText ( self)

Definition at line 26 of file PyPoolBrowser.py.

26 def GetText (self):
27 return self.name
28

◆ IsExpandable()

PyPoolBrowser.EDMItem.IsExpandable ( self)

Definition at line 29 of file PyPoolBrowser.py.

29 def IsExpandable (self):
30 return self.expandable
31

◆ OnDoubleClick()

PyPoolBrowser.EDMItem.OnDoubleClick ( self)

Definition at line 37 of file PyPoolBrowser.py.

37 def OnDoubleClick(self):
38 # not a leaf
39 if self.IsExpandable():
40 return
41 # doesn't belong to a class
42 if self.classKey == None:
43 return
44 # draw histogram
45 x = eval ('PyKernel.plot ("%s#%s", "$x.%s()")' % (objList[self.classKey], self.classKey, self.name))
46 # sleep is needed to draw up canvas
47 time.sleep(1)
48 # return is also needed. see PyKernel.plot
49 return x
50

Member Data Documentation

◆ classKey

PyPoolBrowser.EDMItem.classKey = classKey

Definition at line 24 of file PyPoolBrowser.py.

◆ expandable

PyPoolBrowser.EDMItem.expandable = expandable

Definition at line 23 of file PyPoolBrowser.py.

◆ name

PyPoolBrowser.EDMItem.name = name

Definition at line 21 of file PyPoolBrowser.py.

◆ ref

PyPoolBrowser.EDMItem.ref = ref

Definition at line 22 of file PyPoolBrowser.py.


The documentation for this class was generated from the following file: