Skip to content

Commit

Permalink
Fix sphinx autodoc
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaiter committed Sep 9, 2014
1 parent 19c41fa commit 92951ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 8 additions & 7 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ def __getattr__(cls, name):
print "Getting mock: ", name
if name in ('__file__', '__path__'):
return '/dev/null'
# Special case for CFFI
elif name == 'FFI':
return Mock()
elif name[0] == name[0].upper():
mockType = type(name, (), {})
mockType.__module__ = __name__
return mockType
elif name == 'eval':
def mock_eval(lua_code):
lua_code = lua_code.strip()
if lua_code.startswith('type'):
return False
elif lua_code.startswith('function'):
return lambda *kargs, **kwargs: True
return mock_eval
else:
return Mock()

Expand Down
3 changes: 3 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Requirements

API Reference
=============
.. autoclass:: chdkptp.ChdkDevice
:members:

.. automodule:: chdkptp
:members:

Expand Down

0 comments on commit 92951ad

Please sign in to comment.