CMS 3D CMS Logo

Classes | Functions

valtools Namespace Reference

Classes

class  bcolors
class  benchmark
class  comparison
class  webpage
class  website

Functions

def decodePath
def processFile
def testFileType

Function Documentation

def valtools::decodePath (   path)

Definition at line 274 of file valtools.py.

00275                       :
00276     p = re.compile('^(\S+)/([^\s_]+)_(\S+)');
00277     m = p.match(path)
00278     if m:
00279         release = m.group(1)
00280         benchmarkname = m.group(2)
00281         extension = m.group(3)
00282         return (release, benchmarkname, extension )
00283     else:
00284         return (None, None, None)
00285 
#test that a given file is a file with the correct extenstion, e.g. .root
def valtools::processFile (   file,
  outputDir 
)

Definition at line 304 of file valtools.py.

Referenced by cond::XMLAuthenticationService::XMLAuthenticationService::initialize().

00305                                   :
00306  
00307      if file == "None":
00308           return 'infoNotFound.html'
00309      else:
00310           if os.path.isfile(file):
00311                shutil.copy(file, outputDir)
00312                return os.path.basename(file)
00313           else:
00314                return file

def valtools::testFileType (   file,
  ext 
)

Definition at line 286 of file valtools.py.

00287                              :
00288 
00289      if file == "None":
00290           return
00291      
00292      if os.path.isfile( file ) == False:
00293           print '%s is not a file' % file
00294           sys.exit(2)
00295      
00296      (fileroot, fileext) = os.path.splitext( file )
00297      if fileext != ext:
00298           print '%s does not end with %s' % (file, ext) 
00299           sys.exit(3)
00300 
00301 
00302 # copy a file to a destination directory, and return the basename
00303 # that is the filename without the path. that name is used
# to set a relative link in the html code