Skip to content

Commit

Permalink
Fix up hide_nontasks a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet committed Nov 1, 2012
1 parent faecff6 commit 0d1037a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fabric/docs.py
Expand Up @@ -37,10 +37,11 @@ def unwrap_tasks(module, hide_nontasks=False):
.. seealso:: `~fabric.tasks.WrappedCallableTask`, `~fabric.decorators.task`
"""
for name, obj in vars(module).iteritems():
for name, obj in vars(module).items():
if isinstance(obj, WrappedCallableTask):
setattr(module, name, obj.wrapped)
else:
if hide_nontasks and getattr(obj, '__doc__', False):
has_docstring = getattr(obj, '__doc__', False)
if hide_nontasks and has_docstring and not name.startswith('_'):
setattr(module, '_%s' % name, obj)
delattr(module, name)

0 comments on commit 0d1037a

Please sign in to comment.