CMS 3D CMS Logo

postprocess-scan-build.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 import lxml
3 from bs4 import BeautifulSoup
4 import sys, os
5 url=os.path.abspath(sys.argv[1])
6 report_dir = os.path.dirname(url)
7 page=open(url)
8 soup=BeautifulSoup(page.read(),features="lxml")
9 seen=set()
10 tables=soup.find_all('table',recursive=True)
11 rows = tables[2].findChildren('tr')
12 for row in rows:
13  cells=row.findChildren('td')
14  key=str(cells[2])+str(cells[4])+str(cells[5])
15  if key in seen:
16  href = cells[6].find('a',href=True)
17  if href:
18  report = href['href'].split("#")[0]
19  report_file = os.path.join(report_dir, report)
20  if report.startswith("report-") and os.path.exists(report_file):
21  os.remove(report_file)
22  row.decompose()
23  else:
24  seen.add(key)
25 print soup.prettify("latin1")
BeautifulSoup
Definition: BeautifulSoup.py:1
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
submitPVValidationJobs.split
def split(sequence, size)
Definition: submitPVValidationJobs.py:352
str
#define str(s)
Definition: TestProcessor.cc:51