CMS 3D CMS Logo

Classes | Functions
valtools Namespace Reference

Classes

class  bcolors
 
class  benchmark
 
class  comparison
 
class  webpage
 
class  website
 

Functions

def decodePath (path)
 
def processFile (file, outputDir)
 
def testFileType (file, ext)
 

Function Documentation

def valtools.decodePath (   path)

Definition at line 275 of file valtools.py.

Referenced by valtools.website.listBenchmarks(), and indexGenCompare.processBenchmark().

275 def decodePath( path ):
276  p = re.compile('^(\S+)/([^\s_]+)_(\S+)');
277  m = p.match(path)
278  if m:
279  release = m.group(1)
280  benchmarkname = m.group(2)
281  extension = m.group(3)
282  return (release, benchmarkname, extension )
283  else:
284  return (None, None, None)
285 
286 #test that a given file is a file with the correct extenstion, e.g. .root
def decodePath(path)
Definition: valtools.py:275
def valtools.processFile (   file,
  outputDir 
)

Definition at line 305 of file valtools.py.

305 def processFile( file, outputDir ):
306 
307  if file == "None":
308  return 'infoNotFound.html'
309  else:
310  if os.path.isfile(file):
311  shutil.copy(file, outputDir)
312  return os.path.basename(file)
313  else:
314  return file
315 
def processFile(file, outputDir)
Definition: valtools.py:305
def valtools.testFileType (   file,
  ext 
)

Definition at line 287 of file valtools.py.

References edm.print().

287 def testFileType( file, ext ):
288 
289  if file == "None":
290  return
291 
292  if os.path.isfile( file ) == False:
293  print('%s is not a file' % file)
294  sys.exit(2)
295 
296  (fileroot, fileext) = os.path.splitext( file )
297  if fileext != ext:
298  print('%s does not end with %s' % (file, ext))
299  sys.exit(3)
300 
301 
302 # copy a file to a destination directory, and return the basename
303 # that is the filename without the path. that name is used
304 # to set a relative link in the html code
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def testFileType(file, ext)
Definition: valtools.py:287