# For more information on the PythonDoc tool and the markup format, see
# the PythonDoc page
# at effbot.org.
##
# --------------------------------------------------------------------
# Software License
# --------------------------------------------------------------------
#
# Copyright (c) 2002-2005 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
# and will comply with the following terms and conditions:
#
# Permission to use, copy, modify, and distribute this software and
# its associated documentation for any purpose and without fee is
# hereby granted, provided that the above copyright notice appears in
# all copies, and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of
# Secret Labs AB or the author not be used in advertising or publicity
# pertaining to distribution of the software without specific, written
# prior permission.
#
# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
# ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
#
# --------------------------------------------------------------------
# to do in later releases:
#
# TODO: better rendering of constructors/package modules
# TODO: check @param names against @def/define tags
# TODO: support recursive parsing (-R)
# TODO: warn for tags that doesn't make sense for a given target type
# TODO: HTML output localization (the %s module, returns, raises, etc)
# TODO: make compactHTML generate an element tree instead of raw HTML
#
# nice to have, maybe:
#
# IDEA: support multiple output handlers (multiple -O statements);
# make -x an alias for -Oxml
# IDEA: support pythondoc markup in docstrings
# IDEA: make pythondoc self-contained (include stub element implementation)
VERSION = "2.1b3"
# explicitly import site (for pythonworks exe builder)
import site
# stuff we use in this module
import glob, os, re, string, sys, tokenize
# make sure elementtree is available
try:
from elementtree import ElementTree
from elementtree import HTMLTreeBuilder
except ImportError:
raise RuntimeError(
"PythonDoc %s requires ElementTree 1.1 or later "
"(available from http://effbot.org/downloads)." % VERSION
)
try:
EXTSEP = os.extsep
except AttributeError:
EXTSEP = "."
##
# Debug level. The higher the value, the more junk you'll see on
# standard output.
#