xplorDoc (version 1.13, 10 August 2004)
index
xplorDoc.py

Generate Python documentation in HTML or text for interactive use.
 
In the Python interpreter, do "from pydoc import help" to provide online
help.  Calling help(thing) on a Python object documents the object.
 
Or, at the shell command line outside of Python:
 
Run "pydoc <name>" to show documentation on something.  <name> may be
the name of a function, module, package, or a dotted reference to a
class or function within a module or module in a package.  If the
argument contains a path segment delimiter (e.g. slash on Unix,
backslash on Windows) it is treated as the path to a Python source file.
 
Run "pydoc -k <keyword>" to search for a keyword in the synopsis lines
of all available modules.
 
Run "pydoc -p <port>" to start an HTTP server on a given port on the
local machine to generate documentation web pages.
 
For platforms without a command line, "pydoc -g" starts the HTTP server
and also pops up a little window for controlling it.
 
Run "pydoc -w <name>" to write out the HTML documentation for a module
to a file named "<name>.html".

 
Classes
       
exceptions.Exception(exceptions.BaseException)
ErrorDuringImport
repr.Repr
HTMLRepr
TextRepr
Doc
HTMLDoc
TextDoc
Helper
Scanner
ModuleScanner

 
class Doc
     Methods defined here:
docclass = fail(self, object, name=None, *args)
docmodule = fail(self, object, name=None, *args)
docother = fail(self, object, name=None, *args)
docroutine = fail(self, object, name=None, *args)
document(self, object, name=None, *args)
Generate documentation for an object.
fail(self, object, name=None, *args)
Raise an exception for unimplemented types.

 
class ErrorDuringImport(exceptions.Exception)
    Errors that occurred while trying to import something to document it.
 
 
Method resolution order:
ErrorDuringImport
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__init__(self, filename, (exc, value, tb))
__str__(self)

Data and other attributes defined here:
__weakref__ = <attribute '__weakref__' of 'ErrorDuringImport' objects>
list of weak references to the object (if defined)

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object at 0x2b909a52ce00>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
               
               Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)

Data and other attributes inherited from exceptions.BaseException:
__dict__ = <dictproxy object at 0x1088c90>
args = <attribute 'args' of 'exceptions.BaseException' objects>
message = <member 'message' of 'exceptions.BaseException' objects>
exception message

 
class HTMLDoc(Doc)
    Formatter class for HTML documentation.
 
  Methods defined here:
bigsection(self, title, *args)
Format a section with a big heading.
classlink(self, object, modname)
Make a link for a class.
docclass(self, object, name=None, mod=None, funcs={}, classes={}, *ignored)
Produce HTML documentation for a class object.
docmodule(self, object, name=None, mod=None, *ignored)
Produce HTML documentation for a module object.
docother(self, object, name=None, mod=None, *ignored)
Produce HTML documentation for a data object.
docroutine(self, object, name=None, mod=None, funcs={}, classes={}, methods={}, cl=None)
Produce HTML documentation for a function or method object.
escape(self, text) from HTMLRepr
formattree(self, tree, modname, parent=None)
Produce HTML for a class tree as given by inspect.getclasstree().
formatvalue(self, object)
Format an argument default value as text.
grey(self, text)
heading(self, title, fgcol, bgcol, extras='')
Format a page heading.
index(self, name, dir, shadowed=None)
Generate an HTML index for a directory of modules.
markup(self, text, escape=None, funcs={}, classes={}, methods={})
Mark up some plain text, given a context of symbols to look for.
        some simple tags are defined:
           NAME - creates a link for module named NAME
           NAME - creates a link LINK with tag NAME
        Each context dictionary maps object names to anchor names.
modpkglink(self, (name, path, ispackage, shadowed))
Make a link for a module or package to display in an index.
modulelink(self, object)
Make a link for a module.
multicolumn(self, list, format, cols=4)
Format a list of items into a multi-column list.
namelink(self, name, *dicts)
Make a link for an identifier, given name-to-URL mappings.
page(self, title, contents)
Format an HTML page.
preformat(self, text)
Format literal preformatted text.
repr(self, object) from HTMLRepr
section(self, title, fgcol, bgcol, contents, width=6, prelude='', marginalia=None, gap='&nbsp;')
Format a section with a heading.

Methods inherited from Doc:
document(self, object, name=None, *args)
Generate documentation for an object.
fail(self, object, name=None, *args)
Raise an exception for unimplemented types.

 
class HTMLRepr(repr.Repr)
    Class for safely making an HTML representation of a Python object.
 
  Methods defined here:
__init__(self)
escape(self, text)
repr(self, object)
repr1(self, x, level)
repr_instance(self, x, level)
repr_str = repr_string(self, x, level)
repr_string(self, x, level)
repr_unicode = repr_string(self, x, level)

Methods inherited from repr.Repr:
repr_array(self, x, level)
repr_deque(self, x, level)
repr_dict(self, x, level)
repr_frozenset(self, x, level)
repr_list(self, x, level)
repr_long(self, x, level)
repr_set(self, x, level)
repr_tuple(self, x, level)

 
class Helper
     Methods defined here:
__call__(self, request=None)
__init__(self, input, output)
__repr__(self)
help(self, request)
interact(self)
intro(self)
list(self, items, columns=4, width=80)
listkeywords(self)
listmodules(self, key='')
listtopics(self)
showtopic(self, topic)

Data and other attributes defined here:
keywords = {'and': 'BOOLEAN', 'assert': ('ref/assert', ''), 'break': ('ref/break', 'while for'), 'class': ('ref/class', 'CLASSES SPECIALMETHODS'), 'continue': ('ref/continue', 'while for'), 'def': ('ref/function', ''), 'del': ('ref/del', 'BASICMETHODS'), 'elif': 'if', 'else': ('ref/if', 'while for'), 'except': 'try', ...}
topics = {'ASSERTION': 'assert', 'ASSIGNMENT': ('ref/assignment', 'AUGMENTEDASSIGNMENT'), 'ATTRIBUTEMETHODS': ('ref/attribute-access', 'ATTRIBUTES SPECIALMETHODS'), 'ATTRIBUTES': ('ref/attribute-references', 'getattr hasattr setattr ATTRIBUTEMETHODS'), 'AUGMENTEDASSIGNMENT': ('ref/augassign', 'NUMBERMETHODS'), 'BACKQUOTES': ('ref/string-conversions', 'repr str STRINGS LITERALS'), 'BASICMETHODS': ('ref/customization', 'cmp hash repr str SPECIALMETHODS'), 'BINARY': ('ref/binary', 'EXPRESSIONS'), 'BITWISE': ('ref/bitwise', 'EXPRESSIONS'), 'BOOLEAN': ('ref/Booleans', 'EXPRESSIONS TRUTHVALUE'), ...}

 
class ModuleScanner(Scanner)
    An interruptible scanner that searches module synopses.
 
  Methods defined here:
__init__(self)
isnewpackage(self, (dir, package))
run(self, callback, key=None, completer=None)
submodules(self, (dir, package))

Methods inherited from Scanner:
next(self)

 
class Scanner
    A generic tree iterator.
 
  Methods defined here:
__init__(self, roots, children, descendp)
next(self)

 
class TextDoc(Doc)
    Formatter class for text documentation.
 
  Methods defined here:
bold(self, text)
Format a string in bold by overstriking.
docclass(self, object, name=None, mod=None)
Produce text documentation for a given class object.
docmodule(self, object, name=None, mod=None)
Produce text documentation for a given module object.
docother(self, object, name=None, mod=None, maxlen=None, doc=None)
Produce text documentation for a data object.
docroutine(self, object, name=None, mod=None, cl=None)
Produce text documentation for a function or method object.
formattree(self, tree, modname, parent=None, prefix='')
Render in text a class tree as returned by inspect.getclasstree().
formatvalue(self, object)
Format an argument default value as text.
indent(self, text, prefix=' ')
Indent text by prepending a given prefix to each line.
markup(self, text)
remove markup tags.
repr(self, x) from TextRepr
section(self, title, contents)
Format a section with a given heading.

Methods inherited from Doc:
document(self, object, name=None, *args)
Generate documentation for an object.
fail(self, object, name=None, *args)
Raise an exception for unimplemented types.

 
class TextRepr(repr.Repr)
    Class for safely making a text representation of a Python object.
 
  Methods defined here:
__init__(self)
repr1(self, x, level)
repr_instance(self, x, level)
repr_str = repr_string(self, x, level)
repr_string(self, x, level)

Methods inherited from repr.Repr:
repr(self, x)
repr_array(self, x, level)
repr_deque(self, x, level)
repr_dict(self, x, level)
repr_frozenset(self, x, level)
repr_list(self, x, level)
repr_long(self, x, level)
repr_set(self, x, level)
repr_tuple(self, x, level)

 
Functions
       
allmethods(cl)
apropos(key)
Print all the one-line module summaries that contain a substring.
classname(object, modname)
Get a class name and qualify it with a module name if necessary.
cli()
Command-line interface (looks at sys.argv to decide what to do).
cram(text, maxlen)
Omit part of a string if needed to make it fit in a maximum length.
describe(thing)
Produce a short description of the given thing.
doc(thing, title='Python Library Documentation: %s')
Display text documentation, given an object or a path to an object.
find_string_literal(s, begin=0)
find single-line strings which aren't in HTML tags, and aren't
    already marked up
 
    This won't work inside multiline regions, such as docstrings - strings
    declared within the docstrings will be marked up.
    
getdoc(thing)
Get the doc string or comments for an object.
getpager()
Decide what method to use for paging through text.
gui()
Graphical interface (starts web server and pops up a control window).
importfile(path)
Import a Python source file or compiled file given its path.
includeDirModules(dir)
isdata(object)
Check if an object is of a type that probably means it's data.
ispackage(path)
Guess whether a path refers to a package directory.
ispath(x)
locate(path)
Locate an object by name or dotted path, importing as necessary.
pager(text)
The first time this is called, determine what kind of pager to use.
pathdirs()
Convert sys.path into a list of absolute, existing, unique paths.
pipepager(text, cmd)
Page through text by feeding it to another program.
plain(text)
Remove boldface formatting from text.
plainpager(text)
Simply print unformatted text.  This is the ultimate fallback.
replace(text, *pairs)
Do a series of global replacements on a string.
resolve(thing)
Given an object or a path to an object, get the object and its name.
safeimport(path, cache={})
Import a module; handle errors; return None if the module isn't found.
 
    If the module *is* found but an exception occurs, it's wrapped in an
    ErrorDuringImport exception and reraised.  Unlike __import__, if a
    package path is specified, the module at the end of the path is returned,
    not the package at the beginning. 
serve(port, callback=None, completer=None)
source2HTML(filename)
Colorize/markup Python source code.
    
    Pass filename.  writes output to filename.html
    
    Strings are marked as green, while comments are made red.
    doc strings are made Blue. Functions are made Bold and
    classes Copper.
 
    
    
splitdoc(doc)
Split a doc string into a synopsis line (if any) and the rest.
stripid(text)
Remove the hexadecimal id from a Python object representation.
synopsis(filename, cache={})
Get the one-line summary out of a module file.
tempfilepager(text, cmd)
Page through text by invoking a program on a temporary file.
ttypager(text)
Page through text on a text terminal.
visiblename(name)
Decide whether to show documentation on a variable.
writeIndex(moduleList)
writedoc(thing)
Write HTML documentation to a file in the current directory.
writedocs(dir, pkgpath='', done=None)
Write out HTML documentation for all modules in a directory tree.
xplorSynopsis(modname, cache={})
Get the one-line summary out of a Xplor-NIH module file.

 
Data
        __author__ = 'Charles Schwieters <Charles@Schwieters.org>'
__credits__ = '\nbased on the pydoc module by Ka-Ping Yee.\n'
__date__ = '10 August 2004'
__version__ = '$Revision: 1.13 $'
arch = 'Linux_2.6_x86_64'
environ = {'LESS': '-X', 'TOPPAR_C22': '/home/schwitrs/xpl...ttp://www.hec.utah.edu/~schwitrs/bookmarks.html'}
help = <pydoc.Helper instance>
help_xplorDoc_dontCall = 1
html = <xplorDoc.HTMLDoc instance at 0xc91050>
includedModules = []
markup_re = <_sre.SRE_Pattern object at 0xc9e468>
modulesProcessed = []
pyDocURL = 'http://pydoc.org/2.5/'
pythonModules = ['__builtin__', 'xplor']
string_re = <_sre.SRE_Pattern object at 0xbd0850>
text = <xplorDoc.TextDoc instance at 0xc91170>
xplorDir = '/home/schwitrs/xplor'
xplorPaths = {'high': '/home/schwitrs/xplor/python', 'low': '/home/schwitrs/xplor/bin.Linux_2.6_x86_64'}

 
Author
        Charles Schwieters <Charles@Schwieters.org>

 
Credits
       
based on the pydoc module by Ka-Ping Yee.