#
import sys, comparator, re
-def reporthook(clique):
+def shortreport(clique):
rep = ""
(file, start, end, text) = state.extract_text(clique)
if start == 1 and end == state.files[file]:
rep += text
return rep
+def longreport(clique):
+ rep = ""
+ (tfile, tstart, tend, text) = state.extract_text(clique)
+ for (file, start, end) in clique:
+ if start == 1 and end == state.files[file]:
+ rep += "%% %s:%d-%d: (entire)\n" % (file, start, end)
+ else:
+ rep += "%% %s:%d-%d:\n" % (file, start, end)
+ rep += text
+ return rep
+
if __name__ == '__main__':
# Main line begins here
import getopt
state.cliquefilter(lambda file, start, end: file in matchfiles)
try:
if expand:
- state.metadump(sys.stdout, (75 * '-')+"\n", reporthook, {"Minimum-Size":minsize})
+ state.metadump(sys.stdout, (75 * '-')+"\n", longreport, {"Minimum-Size":minsize})
else:
state.dump(sys.stdout)
except (KeyboardInterrupt, IOError):