# HG changeset patch # User Paul Boddie # Date 1271618936 -7200 # Node ID c73f8387ac01b557ba38e874ce99cb2d52fa5304 # Parent 8edbe04145ad28b63b8c8ea5c0bc62da7f05c830 Changed the initialisation of Summariser instances. Removed a "to do" item. diff -r 8edbe04145ad -r c73f8387ac01 TO_DO.txt --- a/TO_DO.txt Sun Apr 18 21:10:41 2010 +0200 +++ b/TO_DO.txt Sun Apr 18 21:28:56 2010 +0200 @@ -1,9 +1,3 @@ -Where attribute combinations do not yield objects -(tests/abandoned_attribute_usage_multiple_candidates.py) in -Importer._collect_attributes, the individual attributes should be exposed, -since it is apparent that no single object type can satisfy the reported -combination, and thus a guard will not be generated. - Loop entry points should capture usage to update later assignments in the loop. The continue and break statements should affect usage propagation. diff -r 8edbe04145ad -r c73f8387ac01 micropython/report.py --- a/micropython/report.py Sun Apr 18 21:10:41 2010 +0200 +++ b/micropython/report.py Sun Apr 18 21:28:56 2010 +0200 @@ -185,14 +185,19 @@ class Summariser(Writer): - def __init__(self, stream): - self.stream = stream + "Summarise classes and attributes in modules." + + def __init__(self, module): + self.module = module - def process(self, module): - self.module = module + def to_stream(self, stream): + + "Write the summary to the given 'stream'." + + self.stream = stream self._init_details() self.stream.write(html_header) - self._write_classes(module) + self._write_classes(self.module) self.stream.write(html_footer) def _write_classes(self, module): @@ -253,8 +258,8 @@ def summary(module, filename): stream = open(filename, "wb") try: - summariser = Summariser(stream) - summariser.process(module) + summariser = Summariser(module) + summariser.to_stream(stream) finally: stream.close()