def writeDocsFor(self, ob, functionpages): if not ob.isVisible: return isfunc = ob.documentation_location == model.DocLocation.PARENT_PAGE if (isfunc and functionpages) or not isfunc: if self.dry_run: self.total_pages += 1 else: f = open(os.path.join(self.base, link(ob)), 'w') self.writeDocsForOne(ob, f) f.close() for o in ob.orderedcontents: self.writeDocsFor(o, functionpages)