[Python-Dev] supporting Quixote PTL files in pydoc

Skip Montanaro skip at pobox.com
Sat Feb 7 15:16:55 EST 2004


I have this slight change to pydoc.py which allows it to grok Quixote's
PTL-based modules:

% cvs diff -u pydoc.py
Index: pydoc.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pydoc.py,v
retrieving revision 1.90
diff -c -u -r1.90 pydoc.py
cvs diff: conflicting specifications of output style
--- pydoc.py    29 Jan 2004 06:37:49 -0000      1.90
+++ pydoc.py    7 Feb 2004 20:07:43 -0000
@@ -2125,10 +2125,15 @@
     sys.path.insert(0, '.')
 
     try:
-        opts, args = getopt.getopt(sys.argv[1:], 'gk:p:w')
+        opts, args = getopt.getopt(sys.argv[1:], 'gk:p:wq')
         writing = 0
 
         for opt, val in opts:
+            if opt == '-q':
+                # support Quixote's PTL
+                import quixote
+                quixote.enable_ptl()
+                continue
             if opt == '-g':
                 gui()
                 return

I realize this may seem a bit like the tail wagging the dog, but PTL
functions are so close syntactically and semantically to Python that it
seems like a fairly modest change to allow them to be supported.  I wonder
if something like this could reasonably be slipped into the repository
without much fuss?  I have a change for pychecker which allows it to check
PTL modules as well.

For those unfamiliar with it, Quixote's PTL is described here:

    http://www.mems-exchange.org/software/quixote/doc/PTL.html

Skip



More information about the Python-Dev mailing list