summaryrefslogtreecommitdiff
path: root/sphinx/ext/coverage.py
diff options
context:
space:
mode:
authorMartin Brochhaus <mbrochh@gmail.com>2010-09-07 16:22:34 +0200
committerMartin Brochhaus <mbrochh@gmail.com>2010-09-07 16:22:34 +0200
commitb857b46be95c4eecf3f7dacb32d5c64a7d911a4e (patch)
treef98e33bbafab1d0f50e9c6bf589c681b39cbeb02 /sphinx/ext/coverage.py
parent8f2f4db5ac87fe66aec481f345120dac9721f4c0 (diff)
downloadsphinx-git-b857b46be95c4eecf3f7dacb32d5c64a7d911a4e.tar.gz
Removed a rather confusing method by a simpler call to .__doc__
It turned out that at this point we can safely check for .__doc__ wihtout producing exceptions or false positives.
Diffstat (limited to 'sphinx/ext/coverage.py')
-rw-r--r--sphinx/ext/coverage.py16
1 files changed, 1 insertions, 15 deletions
diff --git a/sphinx/ext/coverage.py b/sphinx/ext/coverage.py
index 5bcd12b2c..8bff22487 100644
--- a/sphinx/ext/coverage.py
+++ b/sphinx/ext/coverage.py
@@ -187,8 +187,7 @@ class CoverageBuilder(Builder):
full_attr_name = '%s.%s' % (full_name, attr_name)
if full_attr_name not in objects:
- if not self._is_func_undocumented(
- obj, attr_name):
+ if len(obj.__doc__) > 0:
continue
attrs.append(attr_name)
@@ -198,19 +197,6 @@ class CoverageBuilder(Builder):
self.py_undoc[mod_name] = {'funcs': funcs, 'classes': classes}
- def _is_func_undocumented(self, obj, attr_name):
- """Last check looking at the source code. Is function really not documented?"""
- obj_source = inspect.getsource(obj) or ''
- obj_source = obj_source.replace(' ', '').replace('\n', '')
- if not "def%s" % attr_name in obj_source:
- # Funktion is not defined in this class. No documentation needed.
- return False
- m = re.search('def%s\([^\)]*\):"""' %attr_name, obj_source)
- if not m:
- return True
- else:
- return False
-
def write_py_coverage(self):
output_file = path.join(self.outdir, 'python.txt')
op = open(output_file, 'w')