diff --git a/docs/conf.py b/docs/conf.py index aeada340..9a1c7db6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,6 +13,42 @@ import sys, os +class Mock(object): + def __init__(self, *args, **kwargs): + pass + + def __call__(self, *args, **kwargs): + return Mock() + + @classmethod + def __getattr__(self, name): + if name in ('__file__', '__path__'): + return '/dev/null' + elif name[0] == name[0].upper(): + return type(name, (), {}) + else: + return Mock() + +MOCK_MODULES = [ + 'alsaaudio', + 'dbus', + 'dbus.mainloop', + 'dbus.mainloop.glib', + 'dbus.service', + 'glib', + 'gobject', + 'gst', + 'pygst', + 'pykka', + 'pykka.actor', + 'pykka.future', + 'pykka.registry', + 'pylast', + 'serial', +] +for mod_name in MOCK_MODULES: + sys.modules[mod_name] = Mock() + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here.