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 274 of file valtools.py.

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

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

Definition at line 304 of file valtools.py.

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

Definition at line 286 of file valtools.py.

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