diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-08-10 12:50:09 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-08-10 13:03:40 +0100 |
commit | 2e414327e80fe59a55b9a5676bf38bebec604fed (patch) | |
tree | 68aac11809c95af16d2598618769dc95abf28a21 | |
parent | fd18448d298d2a741303083cdecd7bb21883a0f4 (diff) |
doc: rtfd Mock class hack
this makes autodoc of urwid decendants work again.
cheers to teythoon
closes #496
-rw-r--r-- | docs/source/conf.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/docs/source/conf.py b/docs/source/conf.py index a415a655..4dbe0b5b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -19,8 +19,12 @@ class Mock(object): def __getattr__(self, name): return Mock() if name not in ('__file__', '__path__') else '/dev/null' -MOCK_MODULES = ['notmuch', 'notmuch.globals', - 'twisted', 'twisted.internet', +class MockModule(object): + @classmethod + def __getattr__(self, name): + return Mock if name not in ('__file__', '__path__') else '/dev/null' + +MOCK_MODULES = ['twisted', 'twisted.internet', 'twisted.internet.defer', 'twisted.python', 'twisted.python.failure', @@ -29,7 +33,10 @@ MOCK_MODULES = ['notmuch', 'notmuch.globals', 'magic', 'gpgme', 'argparse'] +MOCK_DIRTY = ['notmuch'] for mod_name in MOCK_MODULES: + sys.modules[mod_name] = MockModule() +for mod_name in MOCK_DIRTY: sys.modules[mod_name] = Mock() # end of readthedocs.org hack |