CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
valtools.website Class Reference

Public Member Functions

def __init__ (self)
 
def __str__ (self)
 
def listBenchmarks (self, pattern, afs=False, url=False)
 
def listComparisons (self, benchmark)
 
def writeAccess (self)
 

Public Attributes

 url_
 
 website_
 

Detailed Description

Definition at line 87 of file valtools.py.

Constructor & Destructor Documentation

◆ __init__()

def valtools.website.__init__ (   self)

Definition at line 88 of file valtools.py.

88  def __init__(self):
89  self.website_ = '/afs/cern.ch/cms/Physics/particleflow/Validation/cms-project-pfvalidation/Releases'
90  self.url_ = 'http://cern.ch/pfvalidation/Releases'
91 

Member Function Documentation

◆ __str__()

def valtools.website.__str__ (   self)

Definition at line 92 of file valtools.py.

92  def __str__(self):
93  return self.website_
94 
95 

References valtools.website.website_.

◆ listBenchmarks()

def valtools.website.listBenchmarks (   self,
  pattern,
  afs = False,
  url = False 
)

Definition at line 101 of file valtools.py.

101  def listBenchmarks(self, pattern, afs=False, url=False):
102  for bench in glob.glob(self.website_ + '/' + pattern):
103  # strip off the root path of the website
104  p = re.compile('^%s/(\S+)$' % self.website_);
105  m = p.match( bench )
106  if m:
107  (release, benchName, extension) = decodePath( m.group(1) )
108  if release == None:
109  # this is a comparison
110  continue
111  print()
112  bench = benchmark(m.group(1))
113  print(bcolors.OKGREEN + m.group(1) + bcolors.ENDC)
114  if afs or url:
115  if afs: print(' ',bench.benchmarkOnWebSite( self ))
116  if url: print(' ',bench.benchmarkUrl( self ))
117 

References valtools.decodePath(), print(), and valtools.website.website_.

◆ listComparisons()

def valtools.website.listComparisons (   self,
  benchmark 
)

Definition at line 118 of file valtools.py.

118  def listComparisons(self, benchmark):
119 
120  comparisons = []
121  find = 'find %s -type d' % self.website_
122  for dir in os.popen( find ):
123  dir = dir.rstrip()
124  #print dir
125  comp = '%s/\S+/\S+/%s' % (self.website_,
126  benchmark.fullName() )
127  #print "** ", comp
128  p = re.compile(comp)
129  m = p.match(dir)
130  if m:
131  comparisons.append(dir)
132  #print ' ',dir
133  return comparisons
134 

References valtools.website.website_.

◆ writeAccess()

def valtools.website.writeAccess (   self)

Definition at line 96 of file valtools.py.

96  def writeAccess(self):
97  if( os.access(self.website_, os.W_OK)==False ):
98  print('cannot write to the website. Please ask Colin to give you access.')
99  sys.exit(1)
100 

References if(), print(), and valtools.website.website_.

Member Data Documentation

◆ url_

valtools.website.url_

Definition at line 90 of file valtools.py.

◆ website_

valtools.website.website_
if
if(0==first)
Definition: CAHitNtupletGeneratorKernelsImpl.h:48
valtools.decodePath
def decodePath(path)
Definition: valtools.py:275
indexGen.benchmark
benchmark
Definition: indexGen.py:35
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
TriggerAnalyzer.__str__
def __str__(self)
Definition: TriggerAnalyzer.py:103
listBenchmarks
Definition: listBenchmarks.py:1