From 61415b7dcfd2c54f131b1ba85555fe3128b7a59d Mon Sep 17 00:00:00 2001 From: Charles Merriam Date: Tue, 27 Jan 2015 13:47:47 -0800 Subject: [PATCH] Close Issue #2921 - build doc failure Fixes issue #2921 as seen in https://groups.google.com/forum/#!topic/kivy-dev/4_DzJUuZAXM. Fixes doc/autobuild.py minor mistake. --- doc/autobuild.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/autobuild.py b/doc/autobuild.py index 31f1ef019..dd91bce34 100644 --- a/doc/autobuild.py +++ b/doc/autobuild.py @@ -173,6 +173,10 @@ template_examples_ref = ('# :ref:`Jump directly to Examples' def extract_summary_line(doc): + """ + :param doc: the __doc__ field of a module + :return: a doc string suitable for a header or empty string + """ if doc is None: return '' for line in doc.split('\n'): @@ -187,7 +191,7 @@ def extract_summary_line(doc): for package in packages: summary = extract_summary_line(sys.modules[package].__doc__) - if summary is None: + if summary is None or summary == '': summary = 'NO DOCUMENTATION (package %s)' % package t = template.replace('$SUMMARY', summary) t = t.replace('$PACKAGE', package) @@ -219,7 +223,7 @@ m.sort() refid = 0 for module in m: summary = extract_summary_line(sys.modules[module].__doc__) - if summary is None: + if summary is None or summary == '': summary = 'NO DOCUMENTATION (module %s)' % package # search examples