gendoc.py: Support modules w/o functions and/or classes.

I.e. don't assume that both are always present.
This commit is contained in:
Paul Sokolovsky 2014-06-29 04:59:11 +03:00
parent a23475979b
commit c10a4405cd

View File

@ -228,11 +228,13 @@ class DocModule(DocItem):
s.append('# module {}'.format(self.name))
s.append('')
s.append(super().dump())
if self.functions:
s.append('')
s.append('## Functions')
for f in sorted(self.functions.values(), key=lambda x:x.name):
s.append('')
s.append(f.dump(self.name))
if self.classes:
s.append('')
s.append('## Classes')
for c in sorted(self.classes.values(), key=lambda x:x.name):