Hi everybody,
I'm currently struggling with the sphinx documentation of a wrapped
module. Lets say I have a module A.py which contains a class `Wrapped`,
which wraps the actual module "A":
#--------------------------------------------------------
class Wrapper(object):
""" module docstring
.. automodule:: A
"""
__name__ = __name__
def __init_(self, wrapped):
self.__wrapped__ = wrapped
@property
def some_module_attribute(self):
""" super important docstring """
import sys
sys.modules[__name__] = Wrapper(sys.modules[__name__])
#----------------------------------------------------------
If I try to reference the Wrapper with automodule directive to get the
attributes of Wrapper documented with sphinx, I'll receive a recursion
error.
If I try to reference single attributes of A, I'll receive an
ImportError, because it seems like the sys.modules[__name__] aliasing
code is never executed by Sphinx custom importer.
My questions so far are:
1. Is this pattern so rude, that Sphinx does not support it or am I
simply doing something wrong here?
2. Is there a way of getting the documentation of Wrapper's attributes
without importing the class?
Best,
Martin
--
You received this message because you are subscribed to the Google Groups
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.