-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 07.01.2011 14:11, schrieb Jakob Malm: > > > On 7 Jan, 10:23, Georg Brandl <ge...@python.org> wrote: >> >> > which works fine. But how can I extract the docstrings from my utility >> > scripts? >> >> You can't do that with autodoc if they are not importable. > > If you organize your utility scripts like this you will at least be > able to get the docstring for the module (file), and data defined: > > """ > Docstring for the script. > > """ > > #: Some data that you want autodoc to catch > SOME_SETTING = 1 > > if __name__ == '__main__': > # Your code goes here... > # but autodoc won't see it, since __name__ != '__main__' when the > python file is imported.
Yes; the only problem is that scripts often have names that aren't valid module names, and so cannot be imported, only directly executed. cheers, Georg -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iEYEARECAAYFAk0nEgIACgkQN9GcIYhpnLAOIACfbNN+2SyWJhr4XYINBb8hEDNT wJYAn1b+9EUP3IIBz7Ag7M/JtdYpN7Ql =gsYw -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-...@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.