[Epydoc-commits] SF.net SVN: epydoc: [1292] trunk/epydoc/doc/faq.html
Brought to you by:
edloper
From: <ed...@us...> - 2006-08-22 15:11:20
|
Revision: 1292 Author: edloper Date: 2006-08-22 08:11:17 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/epydoc/?rev=1292&view=rev Log Message: ----------- - Added FAQ entry for testing if epydoc is currently running Modified Paths: -------------- trunk/epydoc/doc/faq.html Modified: trunk/epydoc/doc/faq.html =================================================================== --- trunk/epydoc/doc/faq.html 2006-08-22 07:31:56 UTC (rev 1291) +++ trunk/epydoc/doc/faq.html 2006-08-22 15:11:17 UTC (rev 1292) @@ -28,6 +28,8 @@ introspection and parsing?</a></li> <li><a href="#parse_only">When should I use <code>--parse-only</code>? </a></li> + <li><a href="#is_epydoc_running">How can I test whether + epydoc is currently running?</a></li> </ul></p> <p><b>Generated Output</b> <ul class="nomargin"> @@ -175,9 +177,26 @@ non-windows machine). </li> <li>You wish to document a module where importing the module would have undesired side effects.</li> - </ul> + </ul></dd> - + <!-- QUESTION --><a name="is_epydoc_running" /> + <dt> <p><b>Q:</b> How can I test whether my program is + being documented by epydoc? + </p></dt> + + <dd> <p>Some programs or libraries need to take special actions when + being documented by epydoc. E.g., you might want your code to skip + certain set-up actions if it's just being imported to be documented. + You can test whether epydoc is currently running by testing whether + <code>'epydoc'</code> is in <code>sys.modules</code>:</p> + +<div class="screen"><pre> + >>> import sys.modules + >>> if 'epydoc' in sys.modules: + ... print 'Epydoc is running' +</pre></div> + </dd> + </dl> <!-- ==================== GENERATED OUTPUT ========================= --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |