Mercurial > dive4elements > river
view artifacts/contrib/find-obsolete-java-files.py @ 8578:4eb1a3c71579
(issue1753) Implement PDF export of SQ Measurement data.
The SQRelationExporter now consists of two reports
(to avoid subreport woes). The old SQReleation PDF
only takes the Page count of the Measurement attachment
as argument to correctly print the page numbers. Otherwise
it is unchanged.
The new SQMeasurements report lists the measured data points
on which the calculation was based.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 16 Mar 2015 11:35:19 +0100 |
parents | f799db6b1219 |
children |
line wrap: on
line source
#!/usr/bin/env python import os import sys def main(): dirs = ['.'] if len(sys.argv) < 2 else sys.argv[1:] cnames = [] for dir in dirs: for root, _, files in os.walk(dir): for f in files: if not (f.endswith(".java") or f.endswith('.xml')): continue p = os.path.join(root, f) with open(p, "rb") as jf: content = jf.read() if f.endswith('.xml'): cnames.append(('', content, p)) else: cname = f[0:-5] cnames.append((cname, content, p)) for i in range(len(cnames)): x = cnames[i] cname = x[0] if cname == '': continue found = False for j in range(len(cnames)): if i == j: continue if cnames[j][1].find(cname) >= 0: found = True break if not found: print cname, x[2] if __name__ == "__main__": main()