python - How do I get stacktraces from epydoc when it is loading my code? -


When I load my code in epydoc and loads the top module it fails Error: type error: 'any type' object is not able to call (line 10)

where NoneType < / Code> It is an epodol trying to load on a 98 line referencing it. How can I get epydoc to understand that it is not able to load in line 9 and instead of loading an error, it can not load on line 9?

Per NOSCO'S REQUEST. Here's the same example, where no stack trace is given:

  # foo.py import bar bar.baz () # bar.py def baz (): print 'baz' Import os os. Environment ['DOES_NOT_EXIST']  

Run with:

  python2.6 epydoc --html foo.py  
< P> Production less than useful:
 + -------------------------------------- | /home/ross/foo.py: | Import failed in (but source code parsing was successful). Error: KeyError: 'DOES_NOT_EXIST' (line1) 
I know that epydoc to tell me that the failure line is on 6 bar.py i foo.py < I do not want to complain about the import of / code> the bar.py I can not reproduce my specific problem in a small example, but my The basic request is that when epydoc fails, I want to print it a stack trace so that the issue can be talked about Could. Whether it is loading a sub-module or finding a key in a dictionary.

Note: The root of this problem is that the document I am trying to write is an input for SCOs in which there are different environments setup problems. This is the reason why when I epydoc < Run in / code>, it does not work, but the script still works while running with scons -f SConstruct.py . I am also trying to make a document with sphinx when I run with sphinx then it actually shows the stack trace, maybe I can read sphinx ...

If I understand correctly, the module that you want to have a module On importing, epydoc is running, which has an error (does not have module for which you want to generate docs)?

If you need to complete, you have to see the line in the file that has an error, so that you can debug it, you can also do this line as well as the line number where the error It must have happened. for that module

So, running:

  epydoc --check foo.py bar.py  

will be output:

  + --------------------------------- --------- ----------------------------------------- --------- ---------------- | /home/mark/Desktop/foo.py: | Import failed in (but source code parsing was successful). Error: KeyIer: 'DOES_NOT_EXIST' (line2) | + ------------------------------------------------- -------------------------------------------------- --------- | /home/mark/Desktop/bar.py: | Import failed in (but source code parsing was successful). Error: KeyIer: 'DOES_NOT_EXIST' (line 7).  

Since Bar.py is also analyzed, the row number where an error has occurred in this file.

Now, if you have a stronger solution because it is a common problem that you need to deal with, you will have to start hacking the epydoc interior if you can , Then I advise you to avoid running this rabbit hole. If switching to sphinx is an option, then I recommend this route


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -