1.1 --- a/micropython/report.py Sun Apr 18 21:10:41 2010 +0200
1.2 +++ b/micropython/report.py Sun Apr 18 21:28:56 2010 +0200
1.3 @@ -185,14 +185,19 @@
1.4
1.5 class Summariser(Writer):
1.6
1.7 - def __init__(self, stream):
1.8 - self.stream = stream
1.9 + "Summarise classes and attributes in modules."
1.10 +
1.11 + def __init__(self, module):
1.12 + self.module = module
1.13
1.14 - def process(self, module):
1.15 - self.module = module
1.16 + def to_stream(self, stream):
1.17 +
1.18 + "Write the summary to the given 'stream'."
1.19 +
1.20 + self.stream = stream
1.21 self._init_details()
1.22 self.stream.write(html_header)
1.23 - self._write_classes(module)
1.24 + self._write_classes(self.module)
1.25 self.stream.write(html_footer)
1.26
1.27 def _write_classes(self, module):
1.28 @@ -253,8 +258,8 @@
1.29 def summary(module, filename):
1.30 stream = open(filename, "wb")
1.31 try:
1.32 - summariser = Summariser(stream)
1.33 - summariser.process(module)
1.34 + summariser = Summariser(module)
1.35 + summariser.to_stream(stream)
1.36 finally:
1.37 stream.close()
1.38