CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/DQMServices/Diagnostic/scripts/Database/Python/DiscoverDQMFiles.py

Go to the documentation of this file.
00001 import os
00002 
00003 class DiscoverDQMFiles:
00004 
00005     def recursive_file_gen(self, mydir):
00006         for root, dirs, files in os.walk(mydir):
00007             for file in files:
00008                 yield os.path.join(root, file)
00009 
00010     def filesList(self, sourceDir, type = ""):
00011         fullList = list(self.recursive_file_gen(sourceDir))
00012         reducedList = list()
00013         for file in fullList:
00014             if file.endswith(".root") and (file.find(type) != -1):
00015                 # print "file passing", file
00016                 reducedList.append(file)
00017         return reducedList