CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
valtools.website Class Reference

Public Member Functions

def __init__
 
def __str__
 
def listBenchmarks
 
def listComparisons
 
def writeAccess
 

Public Attributes

 url_
 
 website_
 

Detailed Description

Definition at line 86 of file valtools.py.

Constructor & Destructor Documentation

def valtools.website.__init__ (   self)

Definition at line 87 of file valtools.py.

87 
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'

Member Function Documentation

def valtools.website.__str__ (   self)

Definition at line 91 of file valtools.py.

References valtools.website.website_.

91 
92  def __str__(self):
93  return self.website_
94 
def valtools.website.listBenchmarks (   self,
  pattern,
  afs = False,
  url = False 
)

Definition at line 100 of file valtools.py.

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

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 )
def decodePath
Definition: valtools.py:274
def valtools.website.listComparisons (   self,
  benchmark 
)

Definition at line 117 of file valtools.py.

References valtools.website.website_.

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
def valtools.website.writeAccess (   self)

Definition at line 95 of file valtools.py.

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

95 
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)
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31

Member Data Documentation

valtools.website.url_

Definition at line 89 of file valtools.py.

valtools.website.website_

Definition at line 88 of file valtools.py.

Referenced by valtools.website.__str__(), valtools.website.listBenchmarks(), valtools.website.listComparisons(), and valtools.website.writeAccess().