4 from BeautifulSoup
import BeautifulSoup
11 p = re.compile(regex,re.IGNORECASE);
12 c = p.sub(replacement,content)
17 for srcFile
in source_htmls:
18 if srcFile.split(
"/")[-1].__str__().
find(w) != -1:
27 for i
in range(len(o)):
28 if re.search(
"[^a-zA-Z]"+w+
"[^a-zA-Z]", o[i]):
29 if re.search(
".*"+k+
".*",o[i]):
32 if betterChoice ==
"" or len(betterChoice) > o[i]:
36 if re.search(
"[^a-zA-Z]"+w+
"[^a-zA-Z]", s):
43 if word.isdigit()
or (len(word) < 5):
47 if not out
or out ==
"":
49 if not out
or out ==
"":
51 return BASE+out.lstrip()
55 if (filename !=
None)
and (len(filename) < 5):
58 fh = open(filename,
'r')
66 pres = soup.findAll(
"pre", {
"class":
"fragment"})
69 if pre.contents !=
None:
70 content += pre.renderContents()
74 content =
replace(
r'<a\b[^>]*>(.*?)</a>',
'',content)
76 content = content.replace(
"'",
"'")
77 content = content.replace(
""",
'"')
80 tmp = re.findall(
'[\w,\.]+_cf[i,g,f]',content)
82 matches.extend(t.split(
"."))
84 matches.extend(re.findall(
'"\w+"',content))
85 matches.extend(re.findall(
"'\w+'",content))
88 map(set.__setitem__, matches, [])
93 match = match.replace(
"'",
"")
94 match = match.replace(
'"',
"")
96 if (INDEX.has_key(match)):
102 INDEX[match] = BASE+href[href.find(
"CMSSW_"):]
104 link =
"<a class=\"configfileLink\" href=\""+href+
"\">"+match+
"</a>"
105 regex =
r"\b"+match+
r"\b"
106 html =
replace(regex, link, html)
110 print ">>>>>["+match+
"]",
118 fh = open(filename,
'w')
122 if len(sys.argv) > 1:
124 DIR = sys.argv[1] +
"/doc/html/"
126 global py_source_htmls
127 global h_source_htmls
132 print "ieskau h_source"
134 query =
"find "+DIR+
" -name '*8h_source.html' -print"
135 output = os.popen(query)
136 h_source_htmls = output.read().
split(
"\n")
138 print "ieskau py_source"
140 query =
"find "+DIR+
" -name '*8py_source.html' -print"
141 output = os.popen(query)
142 py_source_htmls = output.read().
split(
"\n")
144 query =
'find '+DIR+
' \( -name "*cf[i,g,f]*py*html" -or -name "namespace*cf[i,g,f].html" \) -print '
145 output = os.popen(query)
150 print i.__str__()+
") "+file
152 print "-----------------------------------------------------------"
154 print "not enough parameters"
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)