简体   繁体   中英

epydoc executes python file

i have a python file with several classes in it and wanted to use epydoc to create a documentation from my comments. So i do on console on my Debian wheezy system:

epydoc --html storage_config_tool.py -o ~/

It always executes the python application and doc generation stops at 21%. The same behaviour when i use the epydocgui.

When I test it on a simple hello world program everything works fine. The file has > 1000 lines so i can't post it. The program itself works fine.

Has anbody any idea why does it happen? Can wrong formatting be a problem though a couldn't find any yet.

Thx 4 help

Without seeing your code, it's hard to say what the problem is. However, it sounds as if the code to start the application is not protected by a if __name__ == '__main__': statement, so the application is run when epydoc imports the file. Two things that might help:

  1. Fix storage_config_tool.py so that only class , def , and assignment statements are executed when the module is imported.

  2. Use epydoc --html --parse-only storage_config_tool.py -o ~/ to generate the documentation. This skips the module import step, which may or may not be necessary for generating the complete documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM