CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Member Functions

cmsPerfPublish::Table Class Reference

List of all members.

Public Member Functions

def __init__
def __str__
def addRow
def getCols
def getTable
def newRow
def transpose

Public Attributes

 colNames
 keys
 rows

Private Member Functions

def _newCol

Detailed Description

Definition at line 120 of file cmsPerfPublish.py.


Constructor & Destructor Documentation

def cmsPerfPublish::Table::__init__ (   self)

Definition at line 122 of file cmsPerfPublish.py.

00123                       :
00124         self.colNames = []
00125         self.keys     = [None]
00126         self.rows     = {None: self.colNames}


Member Function Documentation

def cmsPerfPublish::Table::__str__ (   self)

Definition at line 127 of file cmsPerfPublish.py.

00128                      :
00129         out = self.keys
00130         out += "\n" + self.rows
00131         return out

def cmsPerfPublish::Table::_newCol (   self,
  name 
) [private]

Definition at line 132 of file cmsPerfPublish.py.

00133                           :
00134         if name in self.colNames:
00135             pass
00136         else:
00137             self.colNames.append(name)

def cmsPerfPublish::Table::addRow (   self,
  row,
  name 
)

Definition at line 178 of file cmsPerfPublish.py.

00179                              :
00180         if name in self.rows.keys():
00181             pass
00182         else:
00183             self.keys.append(name)
00184             self.rows[name] = row
            
def cmsPerfPublish::Table::getCols (   self)

Definition at line 138 of file cmsPerfPublish.py.

00139                      :
00140         return self.colNames

def cmsPerfPublish::Table::getTable (   self,
  mode = 0 
)

Definition at line 150 of file cmsPerfPublish.py.

00151                              :
00152         name = "Total"
00153         
00154         for key in self.keys:
00155             if  key == None:
00156                 pass
00157             else:
00158                 total1 = 0
00159                 total2 = 0                
00160                 rowobj  = self.rows[key]
00161                 rowdict = rowobj.getRowDict()
00162                 for col in self.colNames:
00163                     if col == None:
00164                         pass
00165                     elif rowdict.has_key(col) and not col == name:
00166                         if mode == 1:
00167                             total1 += rowdict[col]
00168                         else:
00169                             (step_tot1, step_tot2) = rowdict[col]
00170                             total1 += step_tot1
00171                             total2 += step_tot2
00172                 if mode == 1:
00173                     rowobj.addEntry(name,total1)                    
00174                 else:
00175                     rowobj.addEntry(name,(total1,total2))
00176                 
00177         return (self.keys, self.rows)

def cmsPerfPublish::Table::newRow (   self,
  name 
)

Definition at line 141 of file cmsPerfPublish.py.

00142                          :
00143         if name in self.rows.keys():
00144             pass
00145         else:
00146             self.keys.append(name)
00147             self.rows[name] = Row(self)
00148             
00149         return self.rows[name]

def cmsPerfPublish::Table::transpose (   self)

Definition at line 185 of file cmsPerfPublish.py.

00186                        :
00187         transp = Table()
00188         for col in self.colnames:
00189             rowobj = transp.newRow(col)
00190             for key in self.keys:
00191                 if key == None:
00192                     pass
00193                 else:
00194                     row_dict = self.rows[key].getRowDict()
00195                     if row_dict.has_key(key):
00196                         rowobj.addEntry(key,row_dict[col])
00197         return transp


Member Data Documentation

Definition at line 122 of file cmsPerfPublish.py.

Definition at line 122 of file cmsPerfPublish.py.

Definition at line 122 of file cmsPerfPublish.py.