Functions | |
def | filter |
def | findMatchingFiles |
def | getLink |
def | process |
def | replace |
Variables | |
string | BASE = "/cmsdoxygen/" |
list | DIR = sys.argv[1] |
tuple | files = output.read() |
list | h_source_htmls = [] |
int | i = 0 |
dictionary | INDEX = {} |
tuple | output = os.popen(query) |
printOutput = False; | |
list | py_source_htmls = [] |
string | query = "find " |
def linker::filter | ( | s, | |
w, | |||
k | |||
) |
Definition at line 23 of file linker.py.
00024 : 00025 o = s.split() 00026 if len(o) > 1: 00027 betterChoice = "" 00028 for i in range(len(o)): 00029 if re.search("[^a-zA-Z]"+w+"[^a-zA-Z]", o[i]): 00030 if re.search(".*"+k+".*",o[i]): 00031 return o[i] 00032 else: 00033 if betterChoice == "" or len(betterChoice) > o[i]: 00034 betterChoice = o[i] 00035 return betterChoice 00036 else: 00037 if re.search("[^a-zA-Z]"+w+"[^a-zA-Z]", s): 00038 return s 00039 else: 00040 return ""
def linker::findMatchingFiles | ( | w, | |
source_htmls | |||
) |
def linker::getLink | ( | word | ) |
Definition at line 41 of file linker.py.
00042 : 00043 00044 if word.isdigit() or (len(word) < 5): 00045 return "" 00046 00047 out = filter(findMatchingFiles(word, py_source_htmls),word,"") 00048 if not out or out == "": 00049 out = filter(findMatchingFiles(word, h_source_htmls),word,"") 00050 if not out or out == "": 00051 return "" 00052 return BASE+out.lstrip()
def linker::process | ( | filename | ) |
Definition at line 53 of file linker.py.
00054 : 00055 00056 if (filename != None) and (len(filename) < 5): 00057 return 00058 00059 fh = open(filename,'r') 00060 html = fh.read() 00061 fh.close() 00062 00063 00064 content = "" 00065 # find only code block 00066 soup = BeautifulSoup(html) 00067 pres = soup.findAll("pre", {"class":"fragment"}) 00068 00069 for pre in pres: 00070 if pre.contents != None: 00071 content += pre.renderContents() 00072 # END OF find only code block 00073 00074 # remove links 00075 content = replace(r'<a\b[^>]*>(.*?)</a>','',content) 00076 00077 content = content.replace("'", "'") 00078 content = content.replace(""", '"') 00079 00080 matches = [] 00081 tmp = re.findall('[\w,\.]+_cf[i,g,f]',content) 00082 for t in tmp: 00083 matches.extend(t.split(".")) 00084 00085 matches.extend(re.findall('"\w+"',content)) 00086 matches.extend(re.findall("'\w+'",content)) 00087 00088 set = {} # 00089 map(set.__setitem__, matches, []) # removing duplicate keywords 00090 matches = set.keys() # 00091 00092 for match in matches: 00093 00094 match = match.replace("'", "") 00095 match = match.replace('"', "") 00096 00097 if (INDEX.has_key(match)): 00098 href = INDEX[match] 00099 else: 00100 href = getLink(match) 00101 00102 if (href != ""): 00103 INDEX[match] = BASE+href[href.find("CMSSW_"):] 00104 00105 link = "<a class=\"configfileLink\" href=\""+href+"\">"+match+"</a>" 00106 regex = r"\b"+match+r"\b" 00107 html = replace(regex, link, html) 00108 00109 ######################## 00110 if printOutput: 00111 print ">>>>>["+match+"]", 00112 ######################## 00113 00114 ######################## 00115 if printOutput: 00116 print href 00117 ######################## 00118 00119 fh = open(filename,'w') 00120 fh.write(html) 00121 fh.close()
def linker::replace | ( | regex, | |
replacement, | |||
content | |||
) |
Definition at line 10 of file linker.py.
Referenced by L1O2OTestAnalyzer::analyze(), L1CondDBIOVWriter::analyze(), MuonTrackAnalyzer::beginJob(), MuonTrackResidualAnalyzer::beginJob(), MuonTrackValidator::beginRun(), MultiTrackValidator::beginRun(), EtaPtBin::buildDescriptionString(), edm::DaqProvenanceHelper::fixMetaData(), L1TriggerKeyDummyProd::L1TriggerKeyDummyProd(), L1MuGMTLUT::Load(), L1MuGMTLUT::MakeSubClass(), L1RCTOmdsFedVectorProducer::produce(), RunInfoRead::readData(), KinematicTree::replaceCurrentParticle(), KinematicTree::replaceCurrentVertex(), and DQMStore::save().
string linker::BASE = "/cmsdoxygen/" |
Definition at line 6 of file linker.py.
Referenced by edm::FileInPath::read(), and edm::FileInPath::readFromParameterSetBlob().
list linker::DIR = sys.argv[1] |
Definition at line 124 of file linker.py.
Referenced by ExternalLHEProducer::closeDescriptors(), HCAL_HLX::ROOTFileReader::CreateFileNameList(), EcalLaserAnalyzerYousi::endJob(), get_filename(), and SiStripCommissioningOfflineClient::setInputFiles().
tuple linker::files = output.read() |
Definition at line 146 of file linker.py.
Referenced by HcalCalibrator::endJob(), fillABSRPFiles(), SiStripDbParams::inputDcuInfoXmlFiles(), SiStripDbParams::inputFecXmlFiles(), SiStripDbParams::inputFedXmlFiles(), SiStripDbParams::inputModuleXmlFiles(), IO::IO(), pftools::IO::IO(), HcalPatternSource::loadPatterns(), main(), PlotCombiner(), and MillePedeAlignmentAlgorithm::terminate().
tuple linker::h_source_htmls = [] |
dictionary linker::INDEX = {} |
tuple linker::output = os.popen(query) |
linker::printOutput = False; |
tuple linker::py_source_htmls = [] |
string linker::query = "find " |