Added ReadTheDocs section to Sphinx's conf.py. This lists modules that need to be mocked up, Ithink.

This commit is contained in:
Dave Clements
2012-11-03 09:34:06 -07:00
parent 9ece96cc8f
commit fed96397ef
+24
View File
@@ -252,3 +252,27 @@ texinfo_documents = [
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# -- ReadTheDocs.org Settings ------------------------------------------------
class Mock(object):
def __init__(self, *args, **kwargs):
pass
def __call__(self, *args, **kwargs):
return Mock()
@classmethod
def __getattr__(cls, name):
if name in ('__file__', '__path__'):
return '/dev/null'
elif name[0] == name[0].upper():
mockType = type(name, (), {})
mockType.__module__ = __name__
return mockType
else:
return Mock()
MOCK_MODULES = ['tables', 'pbs_python', 'DRMAA_python', 'decorator']
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()