Commits

Miran Levar  committed 95371ed

Possible fix for RTD documentation.

  • Participants
  • Parent commits ab5c7c6

Comments (0)

Files changed (1)

File docs/rst/conf.py

     'python': ('http://python.readthedocs.org/en/latest/', None),
 }
 
+
+# Possible fix for rtd documentation
+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():
+            return type(name, (), {})
+        else:
+            return Mock()
+
+MOCK_MODULES = ['Orange']
+for mod_name in MOCK_MODULES:
+    sys.modules[mod_name] = Mock()