CMS 3D CMS Logo

Public Member Functions | Public Attributes

valtools::benchmark Class Reference

List of all members.

Public Member Functions

def __init__
def __str__
def addLinkToComparison
def benchmarkOnWebSite
def benchmarkUrl
def exists
def fullName
def makeRelease
def releaseOnWebSite
def releaseUrl
def rootFileOnWebSite

Public Attributes

 benchmark_
 benchmarkWithExt_
 indexHtml_
 release_

Detailed Description

Definition at line 134 of file valtools.py.


Constructor & Destructor Documentation

def valtools::benchmark::__init__ (   self,
  arg = None 
)

Definition at line 139 of file valtools.py.

00140                                 :
00141 
00142         release = None
00143         benchName = None
00144         extension = None
00145         self.indexHtml_ = 'index.html'
00146         
00147         if arg != None:
00148             (release, benchName, extension) = decodePath( arg )
00149 
00150         if release == None:
00151             # we get there if:
00152             # - arg == None
00153             # - the decoding of arg as a full benchmark name has failed. 
00154             self.release_ = os.environ['CMSSW_VERSION']
00155         
00156             # benchmark directory, as the current working directory
00157             self.benchmark_ = os.path.basename( os.getcwd() )
00158 
00159             # underscore are not allowed in extension names 
00160             if arg!=None and arg.count('_'):
00161                 print 'sorry, as said many times, underscores are not allowed in the extension ;P'
00162                 sys.exit(5)
00163             
00164             extension = arg
00165         else:
00166             self.release_ = release
00167             self.benchmark_ = benchName
00168 
00169         self.benchmarkWithExt_ = self.benchmark_
00170         if( extension != None ):
00171             self.benchmarkWithExt_ = '%s_%s' % (self.benchmark_, extension)
00172 
        

Member Function Documentation

def valtools::benchmark::__str__ (   self)

Definition at line 173 of file valtools.py.

00174                      :
00175         return self.release_ + '/' + self.benchmarkWithExt_

def valtools::benchmark::addLinkToComparison (   self,
  website,
  comparison 
)

Definition at line 214 of file valtools.py.

00215                                                         :
00216         url = comparison.comparisonUrl( website )
00217         index = self.benchmarkOnWebSite(website) + '/' + self.indexHtml_
00218         indexTmp = self.benchmarkOnWebSite(website) + '/index.tmp.html' 
00219         indexFile = open( index)
00220         indexFileTmp = open( indexTmp, 'w')
00221         for line in indexFile:
00222             p = re.compile('<h2>Comparisons:</h2>')
00223             m = p.match(line)
00224             indexFileTmp.write(line)
00225             if m:
00226                 link = '<A href="%s">%s</A><BR>\n' % (url, url)
00227                 indexFileTmp.write(link)
00228         shutil.move( indexTmp, index)

def valtools::benchmark::benchmarkOnWebSite (   self,
  website 
)

Definition at line 182 of file valtools.py.

00183                                            :
00184         return  '%s/%s' % ( website, self.fullName() )
00185 #        return '%s/%s'  % ( self.releaseOnWebSite(website), 
00186 #                            self.benchmarkWithExt_ )

def valtools::benchmark::benchmarkUrl (   self,
  website 
)

Definition at line 195 of file valtools.py.

00196                                      :
00197         return '%s/%s'  % ( self.releaseUrl( website ), 
00198                             self.benchmarkWithExt_ )
    
def valtools::benchmark::exists (   self,
  website 
)

Definition at line 206 of file valtools.py.

00206                               : 
00207         if( os.path.isdir( self.benchmarkOnWebSite(website) )):
00208             print 'benchmark %s exists for release %s' % (self.benchmarkWithExt_, self.release_)
00209             return True
00210         else:
00211             print 'benchmark %s does not exist for release %s' % (self.benchmarkWithExt_, self.release_)
00212             return False
00213 
string DTLocalTriggerBaseTest::fullName (   self)

Definition at line 176 of file valtools.py.

00177                       :
00178         return self.release_ + '/' + self.benchmarkWithExt_
  
def valtools::benchmark::makeRelease (   self,
  website 
)

Definition at line 199 of file valtools.py.

00200                                    :
00201         rel = self.releaseOnWebSite(website)
00202         if( os.path.isdir( rel )==False):
00203             print 'creating release %s' % self.release_
00204             print rel
00205             os.mkdir( rel )

def valtools::benchmark::releaseOnWebSite (   self,
  website 
)

Definition at line 179 of file valtools.py.

00180                                          :
00181         return '%s/%s'  % ( website, self.release_ )

def valtools::benchmark::releaseUrl (   self,
  website 
)

Definition at line 191 of file valtools.py.

00192                                    :
00193         return '%s/%s'  % ( website.url_, self.release_ )
00194 
    
def valtools::benchmark::rootFileOnWebSite (   self,
  website 
)

Definition at line 187 of file valtools.py.

00188                                           :
00189         return '%s/%s'  % ( self.benchmarkOnWebSite(website), 
00190                             'benchmark.root' )
    

Member Data Documentation

Definition at line 139 of file valtools.py.

Definition at line 139 of file valtools.py.

Definition at line 139 of file valtools.py.

Definition at line 139 of file valtools.py.