Can someone tell me what I'm doing wrong?
$ ./setup.py build_sphinx -E
running build_sphinx
Running Sphinx v1.0.4
[..]
/home/nikratio/projekte/python-llfuse/rst/llfuse.rst:9: (WARNING/2) autodoc can't import/find method 'llfuse.llfuse.main', it reported error: "llfuse", please check your spelling and sys.path
[..]
$ cat rst/llfuse.rst
====================
`llfuse` functions
====================
.. py:module:: llfuse
.. automethod:: llfuse.main
$ python -c 'import llfuse; print llfuse.main.__doc__'
Run FUSE main loop
Best,
-Nikolaus
--
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
I did a bit more testing, and it seems that there really are some issues
with the automodule directive.
Consider the attached small sample module bla.py.
> If we add it to PYTHONPART and run sphinx with the an index.rst
> file that just contains:
>
> .. automodule:: bla
> :members:
>
> then everything works as expected. However, if we change to
>
> .. automethod:: bla.mymethod
>
> then we get the following error:
>
> index.rst:1: (WARNING/2) don't know which module to import for autodocumenting u'bla.mymethod' (try placing a "module" or "currentmodule" directive in the document, or giving an explicit module name)
>
> yet if we follow the suggestion and try
>
> .. currentmodule:: bla
> .. automethod:: bla.mymethod
>
> things do not get any better:
>
> index.rst:2: (WARNING/2) autodoc can't import/find method 'bla.bla.mymethod', it reported error: "bla", please check your spelling and sys.path
>
> And even the last alternative,
>
> .. currentmodule:: bla
> .. automethod:: mymethod
>
> fails miserably:
>
> index.rst:2: (WARNING/2) don't know which module to import for autodocumenting u'mymethod' (try placing a "module" or "currentmodule" directive in the document, or giving an explicit module name)
>
>
>
> Is this a bug in automethod or am I just totally failing to understand
> the way to use it?
I wouldn't talk about total failure, but the auto*method* directive needs a
class name. What you want is auto*function*.
cheers,
Georg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
iEYEARECAAYFAky7P2QACgkQN9GcIYhpnLD89ACfSh38hXprGuFKc0j40MYnV92R
XnkAoJnZhfTPKSlHfdEfWtNq1susLDJk
=fK7h
-----END PGP SIGNATURE-----
Arg. Of course. Thanks!