1.1 --- a/simplify/viewer.py Mon Jun 18 00:35:46 2007 +0200
1.2 +++ b/simplify/viewer.py Mon Jun 18 01:47:51 2007 +0200
1.3 @@ -185,8 +185,9 @@
1.4
1.5 class Summariser(Writer):
1.6
1.7 - def __init__(self, stream):
1.8 + def __init__(self, stream, distinct):
1.9 self.stream = stream
1.10 + self.distinct = distinct
1.11
1.12 def process(self, module):
1.13 self.module = module
1.14 @@ -225,7 +226,7 @@
1.15
1.16 # Write instances for the class, along with type details for each attribute.
1.17
1.18 - names_to_instances, instance_names = structure.get_names_to_instances()
1.19 + names_to_instances, instance_names = structure.get_names_to_instances(self.distinct)
1.20
1.21 for instance_name in instance_names:
1.22 instance = names_to_instances[instance_name]
1.23 @@ -1285,10 +1286,10 @@
1.24 browser = Browser(stream or sys.stdout)
1.25 browser.process(module.original)
1.26
1.27 -def makesummary(module, filename):
1.28 +def makesummary(module, filename, distinct=0):
1.29 stream = open(filename, "wb")
1.30 try:
1.31 - summariser = Summariser(stream)
1.32 + summariser = Summariser(stream, distinct=distinct)
1.33 summariser.process(module)
1.34 finally:
1.35 stream.close()
1.36 @@ -1301,12 +1302,12 @@
1.37 finally:
1.38 stream.close()
1.39
1.40 -def makedocs(module, modules, builtins):
1.41 +def makedocs(module, modules, builtins, distinct=0):
1.42 dirname = "%s-docs" % module.name
1.43 if not os.path.exists(dirname):
1.44 os.mkdir(dirname)
1.45 for m in [module, builtins] + modules:
1.46 makedoc(m, os.path.join(dirname, "%s%sxhtml" % (m.name, os.path.extsep)))
1.47 - makesummary(m, os.path.join(dirname, "%s%s%sxhtml" % (m.name, "-summary", os.path.extsep)))
1.48 + makesummary(m, os.path.join(dirname, "%s%s%sxhtml" % (m.name, "-summary", os.path.extsep)), distinct=distinct)
1.49
1.50 # vim: tabstop=4 expandtab shiftwidth=4