epydoc-commits Mailing List for Python API documentation generation tool (Page 16)
Brought to you by:
edloper
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
(77) |
May
|
Jun
(6) |
Jul
(8) |
Aug
(91) |
Sep
(67) |
Oct
(4) |
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(17) |
Feb
(135) |
Mar
(25) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(7) |
Aug
|
Sep
(62) |
Oct
(1) |
Nov
(3) |
Dec
|
2008 |
Jan
(40) |
Feb
(102) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dva...@us...> - 2007-02-05 02:37:17
|
Revision: 1437 http://svn.sourceforge.net/epydoc/?rev=1437&view=rev Author: dvarrazzo Date: 2007-02-04 18:37:15 -0800 (Sun, 04 Feb 2007) Log Message: ----------- - Added a guard against malformed pattern in regular expressions. Modified Paths: -------------- trunk/epydoc/src/epydoc/docbuilder.py Modified: trunk/epydoc/src/epydoc/docbuilder.py =================================================================== --- trunk/epydoc/src/epydoc/docbuilder.py 2007-02-05 02:22:16 UTC (rev 1436) +++ trunk/epydoc/src/epydoc/docbuilder.py 2007-02-05 02:37:15 UTC (rev 1437) @@ -93,6 +93,16 @@ self.exclude_parse = exclude_parse self.add_submodules = add_submodules + # Test for pattern syntax and compile them into pattern objects. + try: + self._introspect_regexp = (exclude_introspect + and re.compile(exclude_introspect)) + self._parse_regexp = (exclude_parse + and re.compile(exclude_parse)) + except Exception, exc: + log.error('Error in regular expression pattern: %s' % exc) + raise + def must_introspect(self, name): """ Return C{True} if a module is to be introsepcted with the current @@ -102,7 +112,7 @@ @type name: L{DottedName} or C{str} """ return self.introspect \ - and not self._matches_filter(name, self.exclude_introspect) + and not self._matches_filter(name, self._introspect_regexp) def must_parse(self, name): """ @@ -112,27 +122,27 @@ @type name: L{DottedName} or C{str} """ return self.parse \ - and not self._matches_filter(name, self.exclude_parse) + and not self._matches_filter(name, self._parse_regexp) - def _matches_filter(self, name, pattern): + def _matches_filter(self, name, regexp): """ Test if a module name matches a pattern. @param name: The name of the module to test @type name: L{DottedName} or C{str} - @param pattern: The pattern to match C{name} againts. + @param regexp: The pattern object to match C{name} against. If C{None}, return C{False} - @type pattern: C{str} - @return: C{True} if C{name} in dotted format matches C{pattern}, + @type regexp: C{pattern} + @return: C{True} if C{name} in dotted format matches C{regexp}, else C{False} @rtype: C{bool} """ - if not pattern: return False + if regexp is None: return False if isinstance(name, DottedName): name = str(name) - return bool(re.search(pattern, name)) + return bool(regexp.search(name)) def build_doc(item, introspect=True, parse=True, add_submodules=True, @@ -184,9 +194,12 @@ @param parse: If true, then use parsing to examine the specified items. Otherwise, just use introspection. """ - options = BuildOptions(parse=parse, introspect=introspect, - exclude_introspect=exclude_introspect, exclude_parse=exclude_parse, - add_submodules=add_submodules) + try: + options = BuildOptions(parse=parse, introspect=introspect, + exclude_introspect=exclude_introspect, exclude_parse=exclude_parse, + add_submodules=add_submodules) + except Exception: + return None # Get the basic docs for each item. doc_pairs = _get_docs_from_items(items, options) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-02-05 02:22:17
|
Revision: 1436 http://svn.sourceforge.net/epydoc/?rev=1436&view=rev Author: dvarrazzo Date: 2007-02-04 18:22:16 -0800 (Sun, 04 Feb 2007) Log Message: ----------- - Added --exclude-introspect and --exclude-parse options. Modified Paths: -------------- trunk/epydoc/src/epydoc/cli.py trunk/epydoc/src/epydoc/docbuilder.py Modified: trunk/epydoc/src/epydoc/cli.py =================================================================== --- trunk/epydoc/src/epydoc/cli.py 2007-02-05 02:02:05 UTC (rev 1435) +++ trunk/epydoc/src/epydoc/cli.py 2007-02-05 02:22:16 UTC (rev 1436) @@ -144,6 +144,14 @@ generation_group.add_option( # --introspect-only "--introspect-only", action="store_false", dest="parse", help="Get all information from introspecting (don't parse)") + generation_group.add_option( # --exclude-introspect + "--exclude-introspect", dest="exclude_introspect", metavar="PATTERN", + help="Exclude introspection of modules whose dotted name matches " + "the regular expression PATTERN") + generation_group.add_option( # --exclude-parse + "--exclude-parse", dest="exclude_parse", metavar="PATTERN", + help="Exclude parsing of modules whose dotted name matches " + "the regular expression PATTERN") generation_group.add_option( # --inheritance "--inheritance", dest="inheritance", metavar="STYLE", help="The format for showing inheritance objects. STYLE " @@ -504,7 +512,9 @@ # Build docs for the named values. from epydoc.docbuilder import build_doc_index docindex = build_doc_index(names, options.introspect, options.parse, - add_submodules=(options.action!='text')) + add_submodules=(options.action!='text'), + exclude_introspect=options.exclude_introspect, + exclude_parse=options.exclude_parse) if docindex is None: return # docbuilder already logged an error. Modified: trunk/epydoc/src/epydoc/docbuilder.py =================================================================== --- trunk/epydoc/src/epydoc/docbuilder.py 2007-02-05 02:02:05 UTC (rev 1435) +++ trunk/epydoc/src/epydoc/docbuilder.py 2007-02-05 02:22:16 UTC (rev 1436) @@ -67,7 +67,7 @@ ## Imports ###################################################################### -import sys, os, os.path, __builtin__, imp +import sys, os, os.path, __builtin__, imp, re from epydoc.apidoc import * from epydoc.docintrospecter import introspect_docs from epydoc.docparser import parse_docs, ParseError @@ -80,8 +80,64 @@ ## 1. build_doc() ###################################################################### -def build_doc(item, introspect=True, parse=True, add_submodules=True): +class BuildOptions: """ + Holds the parameters for a documentation building process. + """ + def __init__(self, introspect=True, parse=True, + exclude_introspect=None, exclude_parse=None, + add_submodules=True): + self.introspect = introspect + self.parse = parse + self.exclude_introspect = exclude_introspect + self.exclude_parse = exclude_parse + self.add_submodules = add_submodules + + def must_introspect(self, name): + """ + Return C{True} if a module is to be introsepcted with the current + settings. + + @param name: The name of the module to test + @type name: L{DottedName} or C{str} + """ + return self.introspect \ + and not self._matches_filter(name, self.exclude_introspect) + + def must_parse(self, name): + """ + Return C{True} if a module is to be parsed with the current settings. + + @param name: The name of the module to test + @type name: L{DottedName} or C{str} + """ + return self.parse \ + and not self._matches_filter(name, self.exclude_parse) + + def _matches_filter(self, name, pattern): + """ + Test if a module name matches a pattern. + + @param name: The name of the module to test + @type name: L{DottedName} or C{str} + @param pattern: The pattern to match C{name} againts. + If C{None}, return C{False} + @type pattern: C{str} + @return: C{True} if C{name} in dotted format matches C{pattern}, + else C{False} + @rtype: C{bool} + """ + if not pattern: return False + + if isinstance(name, DottedName): + name = str(name) + + return bool(re.search(pattern, name)) + + +def build_doc(item, introspect=True, parse=True, add_submodules=True, + exclude_introspect=None, exclude_parse=None): + """ Build API documentation for a given item, and return it as an L{APIDoc} object. @@ -101,11 +157,13 @@ @param parse: If true, then use parsing to examine the specified items. Otherwise, just use introspection. """ - docindex = build_doc_index([item], introspect, parse, add_submodules) + docindex = build_doc_index([item], introspect, parse, add_submodules, + exclude_introspect=exclude_introspect, + exclude_parse=exclude_parse) return docindex.root[0] -def build_doc_index(items, introspect=True, parse=True, - add_submodules=True): +def build_doc_index(items, introspect=True, parse=True, add_submodules=True, + exclude_introspect=None, exclude_parse=None): """ Build API documentation for the given list of items, and return it in the form of a L{DocIndex}. @@ -126,11 +184,15 @@ @param parse: If true, then use parsing to examine the specified items. Otherwise, just use introspection. """ + options = BuildOptions(parse=parse, introspect=introspect, + exclude_introspect=exclude_introspect, exclude_parse=exclude_parse, + add_submodules=add_submodules) + # Get the basic docs for each item. - doc_pairs = _get_docs_from_items(items, introspect, parse, add_submodules) + doc_pairs = _get_docs_from_items(items, options) # Merge the introspection & parse docs. - if parse and introspect: + if options.parse and options.introspect: log.start_progress('Merging parsed & introspected information') docs = [] for i, (introspect_doc, parse_doc) in enumerate(doc_pairs): @@ -146,7 +208,7 @@ elif parse_doc is not None: docs.append(parse_doc) log.end_progress() - elif introspect: + elif options.introspect: docs = [doc_pair[0] for doc_pair in doc_pairs if doc_pair[0]] else: docs = [doc_pair[1] for doc_pair in doc_pairs if doc_pair[1]] @@ -160,7 +222,7 @@ # Replace any proxy valuedocs that we got from importing with # their targets. - if parse: + if options.parse: log.start_progress('Linking imported variables') valdocs = sorted(docindex.reachable_valdocs( imports=False, submodules=False, packages=False, subclasses=False)) @@ -230,7 +292,8 @@ # Documentation Generation #///////////////////////////////////////////////////////////////// -def _get_docs_from_items(items, introspect, parse, add_submodules): +def _get_docs_from_items(items, options): + # Start the progress bar. log.start_progress('Building documentation') progress_estimator = _ProgressEstimator(items) @@ -241,21 +304,21 @@ if isinstance(item, basestring): if is_module_file(item): doc_pairs.append(_get_docs_from_module_file( - item, introspect, parse, progress_estimator)) + item, options, progress_estimator)) elif is_package_dir(item): pkgfile = os.path.abspath(os.path.join(item, '__init__')) doc_pairs.append(_get_docs_from_module_file( - pkgfile, introspect, parse, progress_estimator)) + pkgfile, options, progress_estimator)) elif os.path.isfile(item): doc_pairs.append(_get_docs_from_pyscript( - item, introspect, parse, progress_estimator)) + item, options, progress_estimator)) elif hasattr(__builtin__, item): val = getattr(__builtin__, item) doc_pairs.append(_get_docs_from_pyobject( - val, introspect, parse, progress_estimator)) + val, options, progress_estimator)) elif is_pyname(item): doc_pairs.append(_get_docs_from_pyname( - item, introspect, parse, progress_estimator)) + item, options, progress_estimator)) elif os.path.isdir(item): log.error("Directory %r is not a package" % item) continue @@ -268,24 +331,24 @@ continue else: doc_pairs.append(_get_docs_from_pyobject( - item, introspect, parse, progress_estimator)) + item, options, progress_estimator)) # This will only have an effect if doc_pairs[-1] contains a # package's docs. The 'not is_module_file(item)' prevents # us from adding subdirectories if they explicitly specify # a package's __init__.py file. - if add_submodules and not is_module_file(item): + if options.add_submodules and not is_module_file(item): doc_pairs += _get_docs_from_submodules( - item, doc_pairs[-1], introspect, parse, progress_estimator) + item, doc_pairs[-1], options, progress_estimator) log.end_progress() return doc_pairs -def _get_docs_from_pyobject(obj, introspect, parse, progress_estimator): +def _get_docs_from_pyobject(obj, options, progress_estimator): progress_estimator.complete += 1 log.progress(progress_estimator.progress(), repr(obj)) - if not introspect: + if not options.introspect: log.error("Cannot get docs for Python objects without " "introspecting them.") @@ -296,11 +359,17 @@ except ImportError, e: log.error(e) return (None, None) - if parse: + if options.parse: if introspect_doc.canonical_name is not None: - _, parse_docs = _get_docs_from_pyname( - str(introspect_doc.canonical_name), False, True, - progress_estimator, supress_warnings=True) + prev_introspect = options.introspect + options.introspect = False + try: + _, parse_docs = _get_docs_from_pyname( + str(introspect_doc.canonical_name), options, + progress_estimator, supress_warnings=True) + finally: + options.introspect = prev_introspect + # We need a name: if introspect_doc.canonical_name in (None, UNKNOWN): if hasattr(obj, '__name__'): @@ -311,19 +380,19 @@ DottedName.UNREACHABLE) return (introspect_doc, parse_doc) -def _get_docs_from_pyname(name, introspect, parse, progress_estimator, +def _get_docs_from_pyname(name, options, progress_estimator, supress_warnings=False): progress_estimator.complete += 1 log.progress(progress_estimator.progress(), name) introspect_doc = parse_doc = None introspect_error = parse_error = None - if introspect: + if options.must_introspect(name): try: introspect_doc = introspect_docs(name=name) except ImportError, e: introspect_error = str(e) - if parse: + if options.must_parse(name): try: parse_doc = parse_docs(name=name) except ParseError, e: @@ -341,18 +410,18 @@ # Return the docs we found. return (introspect_doc, parse_doc) -def _get_docs_from_pyscript(filename, introspect, parse, progress_estimator): +def _get_docs_from_pyscript(filename, options, progress_estimator): # [xx] I should be careful about what names I allow as filenames, # and maybe do some munging to prevent problems. introspect_doc = parse_doc = None introspect_error = parse_error = None - if introspect: + if options.introspect: try: introspect_doc = introspect_docs(filename=filename, is_script=True) except ImportError, e: introspect_error = str(e) - if parse: + if options.parse: try: parse_doc = parse_docs(filename=filename, is_script=True) except ParseError, e: @@ -367,7 +436,7 @@ # Return the docs we found. return (introspect_doc, parse_doc) -def _get_docs_from_module_file(filename, introspect, parse, progress_estimator, +def _get_docs_from_module_file(filename, options, progress_estimator, parent_docs=(None,None)): """ Construct and return the API documentation for the python @@ -406,13 +475,13 @@ # Get the introspected & parsed docs (as appropriate) introspect_doc = parse_doc = None introspect_error = parse_error = None - if introspect: + if options.must_introspect(modulename): try: introspect_doc = introspect_docs( filename=filename, context=parent_docs[0]) except ImportError, e: introspect_error = str(e) - if parse and src_file_available: + if src_file_available and options.must_parse(modulename): try: parse_doc = parse_docs( filename=filename, context=parent_docs[1]) @@ -428,8 +497,7 @@ # Return the docs we found. return (introspect_doc, parse_doc) -def _get_docs_from_submodules(item, pkg_docs, introspect, parse, - progress_estimator): +def _get_docs_from_submodules(item, pkg_docs, options, progress_estimator): # Extract the package's __path__. if isinstance(pkg_docs[0], ModuleDoc) and pkg_docs[0].is_package: pkg_path = pkg_docs[0].path @@ -462,14 +530,14 @@ docs = [pkg_docs] for module_filename in module_filenames.values(): d = _get_docs_from_module_file( - module_filename, introspect, parse, progress_estimator, pkg_docs) + module_filename, options, progress_estimator, pkg_docs) docs.append(d) for subpackage_dir in subpackage_dirs: subpackage_file = os.path.join(subpackage_dir, '__init__') docs.append(_get_docs_from_module_file( - subpackage_file, introspect, parse, progress_estimator, pkg_docs)) + subpackage_file, options, progress_estimator, pkg_docs)) docs += _get_docs_from_submodules( - subpackage_dir, docs[-1], introspect, parse, progress_estimator) + subpackage_dir, docs[-1], options, progress_estimator) return docs def _report_errors(name, introspect_doc, parse_doc, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-02-05 02:02:09
|
Revision: 1435 http://svn.sourceforge.net/epydoc/?rev=1435&view=rev Author: dvarrazzo Date: 2007-02-04 18:02:05 -0800 (Sun, 04 Feb 2007) Log Message: ----------- - Fixed duplicated items in subclasses list. - Fixed SF bug #1646408 using Ed's patch. Modified Paths: -------------- trunk/epydoc/src/epydoc/docparser.py Modified: trunk/epydoc/src/epydoc/docparser.py =================================================================== --- trunk/epydoc/src/epydoc/docparser.py 2007-02-04 15:46:13 UTC (rev 1434) +++ trunk/epydoc/src/epydoc/docparser.py 2007-02-05 02:02:05 UTC (rev 1435) @@ -1544,7 +1544,17 @@ if class_doc.bases is not UNKNOWN: for basedoc in class_doc.bases: if isinstance(basedoc, ClassDoc): - basedoc.subclasses.append(class_doc) + # This test avoids that a subclass gets listed twice when + # both introspection and parsing. + # [XXX] This check only works because currently parsing is + # always performed just after introspection of the same + # class. A more complete fix shuld be independent from + # calling order; probably the subclasses list should be + # replaced by a ClassDoc set or a {name: ClassDoc} mapping. + if (basedoc.subclasses + and basedoc.subclasses[-1].canonical_name + != class_doc.canonical_name): + basedoc.subclasses.append(class_doc) # If the preceeding comment includes a docstring, then add it. add_docstring_from_comments(class_doc, comments) @@ -1571,8 +1581,10 @@ src = lookup_name(name[0], parent_docs) if (src is not None and src.imported_from not in (None, UNKNOWN)): - _import_var(name, parent_docs) - base_var = lookup_variable(name, parent_docs) + base_src = DottedName(src.imported_from, name[1:]) + base_var = VariableDoc(name=name[-1], is_imported=True, + is_alias=False, imported_from=base_src, + docs_extracted_by='parser') # Otherwise, it must have come from an "import *" statement # (or from magic, such as direct manipulation of the module's # dictionary), so we don't know where it came from. So This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-02-04 15:46:16
|
Revision: 1434 http://svn.sourceforge.net/epydoc/?rev=1434&view=rev Author: dvarrazzo Date: 2007-02-04 07:46:13 -0800 (Sun, 04 Feb 2007) Log Message: ----------- - Also check for an `UNKNOWN` defining module, which doesn't happen to have a canonical name... Modified Paths: -------------- trunk/epydoc/src/epydoc/docintrospecter.py Modified: trunk/epydoc/src/epydoc/docintrospecter.py =================================================================== --- trunk/epydoc/src/epydoc/docintrospecter.py 2007-02-04 04:03:48 UTC (rev 1433) +++ trunk/epydoc/src/epydoc/docintrospecter.py 2007-02-04 15:46:13 UTC (rev 1434) @@ -364,7 +364,7 @@ # The module name is not defined if the class is being introspected # as another class base. - if module_name is None and class_doc.defining_module is not None: + if module_name is None and class_doc.defining_module not in (None, UNKNOWN): module_name = class_doc.defining_module.canonical_name # Record the class's local variables. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-02-04 04:03:50
|
Revision: 1433 http://svn.sourceforge.net/epydoc/?rev=1433&view=rev Author: dvarrazzo Date: 2007-02-03 20:03:48 -0800 (Sat, 03 Feb 2007) Log Message: ----------- - Command line help reorganized. Modified Paths: -------------- trunk/epydoc/src/epydoc/cli.py Modified: trunk/epydoc/src/epydoc/cli.py =================================================================== --- trunk/epydoc/src/epydoc/cli.py 2007-02-04 03:12:25 UTC (rev 1432) +++ trunk/epydoc/src/epydoc/cli.py 2007-02-04 04:03:48 UTC (rev 1433) @@ -65,7 +65,7 @@ import sys, os, time, re, pickle from glob import glob -from optparse import OptionParser, OptionGroup +from optparse import OptionParser, OptionGroup, SUPPRESS_HELP import epydoc from epydoc import log from epydoc.util import wordwrap, run_subprocess, RunSubprocessError @@ -89,8 +89,24 @@ version = "Epydoc, version %s" % epydoc.__version__ optparser = OptionParser(usage=usage, version=version) action_group = OptionGroup(optparser, 'Actions') - options_group = OptionGroup(optparser, 'Options') + generation_group = OptionGroup(optparser, 'Generation options') + output_group = OptionGroup(optparser, 'Output options') + graph_group = OptionGroup(optparser, 'Graph options') + optparser.add_option( + '--config', action='append', dest="configfiles", metavar='FILE', + help=("A configuration file, specifying additional OPTIONS " + "and/or NAMES. This option may be repeated.")) + optparser.add_option( # --quiet + "--quiet", "-q", action="count", dest="quiet", + help="Decrease the verbosity.") + optparser.add_option( # --verbose + "--verbose", "-v", action="count", dest="verbose", + help="Increase the verbosity.") + optparser.add_option( # --debug + "--debug", action="store_true", dest="debug", + help="Show full tracebacks for internal errors.") + # Add options -- Actions action_group.add_option( # --html "--html", action="store_const", dest="action", const="html", @@ -117,88 +133,85 @@ "--pickle", action="store_const", dest="action", const="pickle", help="Write the documentation to a pickle file.") - # Add options -- Options - options_group.add_option( # --output + # Add options -- Generation + generation_group.add_option( # --docformat + "--docformat", dest="docformat", metavar="NAME", + help="The default markup language for docstrings. Defaults " + "to \"%s\"." % DEFAULT_DOCFORMAT) + generation_group.add_option( # --parse-only + "--parse-only", action="store_false", dest="introspect", + help="Get all information from parsing (don't introspect)") + generation_group.add_option( # --introspect-only + "--introspect-only", action="store_false", dest="parse", + help="Get all information from introspecting (don't parse)") + generation_group.add_option( # --inheritance + "--inheritance", dest="inheritance", metavar="STYLE", + help="The format for showing inheritance objects. STYLE " + "should be one of: %s." % ', '.join(INHERITANCE_STYLES)) + generation_group.add_option( # --show-private + "--show-private", action="store_true", dest="show_private", + help="Include private variables in the output. (default)") + generation_group.add_option( # --no-private + "--no-private", action="store_false", dest="show_private", + help="Do not include private variables in the output.") + generation_group.add_option( # --show-imports + "--show-imports", action="store_true", dest="show_imports", + help="List each module's imports.") + generation_group.add_option( # --no-imports + "--no-imports", action="store_false", dest="show_imports", + help="Do not list each module's imports. (default)") + generation_group.add_option( # --show-sourcecode + '--show-sourcecode', action='store_true', dest='include_source_code', + help=("Include source code with syntax highlighting in the " + "HTML output. (default)")) + generation_group.add_option( # --no-sourcecode + '--no-sourcecode', action='store_false', dest='include_source_code', + help=("Do not include source code with syntax highlighting in the " + "HTML output.")) + + # Add options -- Output + output_group.add_option( # --output "--output", "-o", dest="target", metavar="PATH", help="The output directory. If PATH does not exist, then " "it will be created.") - options_group.add_option( # --show-imports - "--inheritance", dest="inheritance", metavar="STYLE", - help="The format for showing inheritance objects. STYLE " - "should be one of: %s." % ', '.join(INHERITANCE_STYLES)) - options_group.add_option( # --output - "--docformat", dest="docformat", metavar="NAME", - help="The default markup language for docstrings. Defaults " - "to \"%s\"." % DEFAULT_DOCFORMAT) - options_group.add_option( # --css + output_group.add_option( # --css "--css", dest="css", metavar="STYLESHEET", help="The CSS stylesheet. STYLESHEET can be either a " "builtin stylesheet or the name of a CSS file.") - options_group.add_option( # --name + output_group.add_option( # --name "--name", dest="prj_name", metavar="NAME", help="The documented project's name (for the navigation bar).") - options_group.add_option( # --url + output_group.add_option( # --url "--url", dest="prj_url", metavar="URL", help="The documented project's URL (for the navigation bar).") - options_group.add_option( # --navlink + output_group.add_option( # --navlink "--navlink", dest="prj_link", metavar="HTML", help="HTML code for a navigation link to place in the " "navigation bar.") - options_group.add_option( # --top + output_group.add_option( # --top "--top", dest="top_page", metavar="PAGE", help="The \"top\" page for the HTML documentation. PAGE can " "be a URL, the name of a module or class, or one of the " "special names \"trees.html\", \"indices.html\", or \"help.html\"") - options_group.add_option( # --help-file + output_group.add_option( # --help-file "--help-file", dest="help_file", metavar="FILE", help="An alternate help file. FILE should contain the body " "of an HTML file -- navigation bars will be added to it.") - options_group.add_option( # --frames + output_group.add_option( # --frames "--show-frames", action="store_true", dest="show_frames", help="Include frames in the HTML output. (default)") - options_group.add_option( # --no-frames + output_group.add_option( # --no-frames "--no-frames", action="store_false", dest="show_frames", help="Do not include frames in the HTML output.") - options_group.add_option( # --private - "--show-private", action="store_true", dest="show_private", - help="Include private variables in the output. (default)") - options_group.add_option( # --no-private - "--no-private", action="store_false", dest="show_private", - help="Do not include private variables in the output.") - options_group.add_option( # --show-imports - "--show-imports", action="store_true", dest="show_imports", - help="List each module's imports.") - options_group.add_option( # --show-imports - "--no-imports", action="store_false", dest="show_imports", - help="Do not list each module's imports. (default)") - options_group.add_option( # --quiet - "--quiet", "-q", action="count", dest="quiet", - help="Decrease the verbosity.") - options_group.add_option( # --verbose - "--verbose", "-v", action="count", dest="verbose", - help="Increase the verbosity.") - options_group.add_option( # --debug - "--debug", action="store_true", dest="debug", - help="Show full tracebacks for internal errors.") - options_group.add_option( # --parse-only - "--parse-only", action="store_false", dest="introspect", - help="Get all information from parsing (don't introspect)") - options_group.add_option( # --introspect-only - "--introspect-only", action="store_false", dest="parse", - help="Get all information from introspecting (don't parse)") - # this option is for developers, not users. - options_group.add_option( - "--profile-epydoc", action="store_true", dest="profile", - help=("Run the hotshot profiler on epydoc itself. Output " - "will be written to profile.out.")) - options_group.add_option( - "--dotpath", dest="dotpath", metavar='PATH', - help="The path to the Graphviz 'dot' executable.") - options_group.add_option( - '--config', action='append', dest="configfiles", metavar='FILE', - help=("A configuration file, specifying additional OPTIONS " - "and/or NAMES. This option may be repeated.")) - options_group.add_option( + output_group.add_option( # --separate-classes + '--separate-classes', action='store_true', + dest='list_classes_separately', + help=("When generating LaTeX or PDF output, list each class in " + "its own section, instead of listing them under their " + "containing module.")) + + # Add options -- Graph options + graph_group.add_option( '--graph', action='append', dest='graphs', metavar='GRAPHTYPE', help=("Include graphs of type GRAPHTYPE in the generated output. " "Graphs are generated using the Graphviz dot executable. " @@ -206,35 +219,32 @@ "to specify its location. This option may be repeated to " "include multiple graph types in the output. GRAPHTYPE " "should be one of: all, %s." % ', '.join(GRAPH_TYPES))) - options_group.add_option( + graph_group.add_option( + "--dotpath", dest="dotpath", metavar='PATH', + help="The path to the Graphviz 'dot' executable.") + graph_group.add_option( '--graph-font', dest='graph_font', metavar='FONT', help=("Specify the font used to generate Graphviz graphs. (e.g., " "helvetica or times).")) - options_group.add_option( + graph_group.add_option( '--graph-font-size', dest='graph_font_size', metavar='SIZE', help=("Specify the font size used to generate Graphviz graphs, " "in points.")) - options_group.add_option( - '--separate-classes', action='store_true', - dest='list_classes_separately', - help=("When generating LaTeX or PDF output, list each class in " - "its own section, instead of listing them under their " - "containing module.")) - options_group.add_option( - '--show-sourcecode', action='store_true', dest='include_source_code', - help=("Include source code with syntax highlighting in the " - "HTML output.")) - options_group.add_option( - '--no-sourcecode', action='store_false', dest='include_source_code', - help=("Do not include source code with syntax highlighting in the " - "HTML output.")) - options_group.add_option( + graph_group.add_option( '--pstat', action='append', dest='pstat_files', metavar='FILE', help="A pstat output file, to be used in generating call graphs.") + # this option is for developers, not users. + graph_group.add_option( + "--profile-epydoc", action="store_true", dest="profile", + help=SUPPRESS_HELP or + ("Run the hotshot profiler on epydoc itself. Output " + "will be written to profile.out.")) # Add the option groups. optparser.add_option_group(action_group) - optparser.add_option_group(options_group) + optparser.add_option_group(generation_group) + optparser.add_option_group(output_group) + optparser.add_option_group(graph_group) # Set the option parser's defaults. optparser.set_defaults(action="html", show_frames=True, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-02-04 03:12:26
|
Revision: 1432 http://svn.sourceforge.net/epydoc/?rev=1432&view=rev Author: dvarrazzo Date: 2007-02-03 19:12:25 -0800 (Sat, 03 Feb 2007) Log Message: ----------- - Fixed encoding propagation to class children when the class is being introspected as another class base. Modified Paths: -------------- trunk/epydoc/src/epydoc/docintrospecter.py Modified: trunk/epydoc/src/epydoc/docintrospecter.py =================================================================== --- trunk/epydoc/src/epydoc/docintrospecter.py 2007-02-04 02:57:23 UTC (rev 1431) +++ trunk/epydoc/src/epydoc/docintrospecter.py 2007-02-04 03:12:25 UTC (rev 1432) @@ -362,6 +362,11 @@ if hasattr(base, '__dict__'): base_children.update(base.__dict__) + # The module name is not defined if the class is being introspected + # as another class base. + if module_name is None and class_doc.defining_module is not None: + module_name = class_doc.defining_module.canonical_name + # Record the class's local variables. class_doc.variables = {} if hasattr(cls, '__dict__'): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-02-04 02:57:24
|
Revision: 1431 http://svn.sourceforge.net/epydoc/?rev=1431&view=rev Author: dvarrazzo Date: 2007-02-03 18:57:23 -0800 (Sat, 03 Feb 2007) Log Message: ----------- - In case of a IOError, raise OSError instead, to respect the function signature enforced by many callers. IOError may happen e.g. when the program is not found. Modified Paths: -------------- trunk/epydoc/src/epydoc/util.py Modified: trunk/epydoc/src/epydoc/util.py =================================================================== --- trunk/epydoc/src/epydoc/util.py 2007-02-04 02:45:37 UTC (rev 1430) +++ trunk/epydoc/src/epydoc/util.py 2007-02-04 02:57:23 UTC (rev 1431) @@ -269,7 +269,11 @@ else: to_child, from_child, child_err = os.popen3(' '.join(cmd), 'b') if data: - to_child.write(data) + try: + to_child.write(data) + # Guard for a broken pipe error + except IOError, e: + raise OSError(e) to_child.close() err = child_err.read() out = from_child.read() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-02-04 02:45:40
|
Revision: 1430 http://svn.sourceforge.net/epydoc/?rev=1430&view=rev Author: dvarrazzo Date: 2007-02-03 18:45:37 -0800 (Sat, 03 Feb 2007) Log Message: ----------- - Intercept the base OSError, which can be raised in some circumstance, e.g. when the command is not found. Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/dotgraph.py Modified: trunk/epydoc/src/epydoc/docwriter/dotgraph.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/dotgraph.py 2007-02-03 03:51:05 UTC (rev 1429) +++ trunk/epydoc/src/epydoc/docwriter/dotgraph.py 2007-02-04 02:45:37 UTC (rev 1430) @@ -1238,7 +1238,7 @@ _dot_version = [int(x) for x in m.group(1).split('.')] else: _dot_version = (0,) - except RunSubprocessError, e: + except OSError, e: _dot_version = (0,) log.info('Detected dot version %s' % _dot_version) return _dot_version This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-02-03 03:51:07
|
Revision: 1429 http://svn.sourceforge.net/epydoc/?rev=1429&view=rev Author: edloper Date: 2007-02-02 19:51:05 -0800 (Fri, 02 Feb 2007) Log Message: ----------- - Relaxed the regular expression DottedName._IDENTIFIER_RE, to allow for names like "script-00_info_py". (sf bug #1649347) Modified Paths: -------------- trunk/epydoc/src/epydoc/apidoc.py Modified: trunk/epydoc/src/epydoc/apidoc.py =================================================================== --- trunk/epydoc/src/epydoc/apidoc.py 2007-01-30 11:35:50 UTC (rev 1428) +++ trunk/epydoc/src/epydoc/apidoc.py 2007-02-03 03:51:05 UTC (rev 1429) @@ -63,10 +63,9 @@ """ UNREACHABLE = "??" _IDENTIFIER_RE = re.compile("""(?x) - (%s | # UNREACHABLE marker, or.. - (script-)? # Prefix: script (not a module) - [a-zA-Z_]\w* # Identifier - '?) # Suffix: submodule that is shadowed by a var + (%s | # UNREACHABLE marker, or... + script-\w+ | # Script name, or ... + [a-zA-Z_]\w*'?) # Identifier. (' used for shadowing submodules) (-\d+)? # Suffix: unreachable vals with the same name $""" % re.escape(UNREACHABLE)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-01-30 11:35:51
|
Revision: 1428 http://svn.sourceforge.net/epydoc/?rev=1428&view=rev Author: dvarrazzo Date: 2007-01-30 03:35:50 -0800 (Tue, 30 Jan 2007) Log Message: ----------- - Hashbang fixed - Description fixed Modified Paths: -------------- trunk/epydoc/src/setup.py Modified: trunk/epydoc/src/setup.py =================================================================== --- trunk/epydoc/src/setup.py 2007-01-29 01:11:49 UTC (rev 1427) +++ trunk/epydoc/src/setup.py 2007-01-30 11:35:50 UTC (rev 1428) @@ -1,7 +1,6 @@ -#!/usr/local/bin/python +#! /usr/bin/env python # -# Distutils setup script for the Natural Language -# Processing Toolkit +# Edward Loper's API Documentation Generation Tool # # Created [05/27/01 09:04 PM] # Edward Loper This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-01-29 01:11:50
|
Revision: 1427 http://svn.sourceforge.net/epydoc/?rev=1427&view=rev Author: dvarrazzo Date: 2007-01-28 17:11:49 -0800 (Sun, 28 Jan 2007) Log Message: ----------- - Fixed signature for `get_canonical_name()`. Not looking for `UNKNOWN` caused bug while introspecting packages such as twisted and maybe caused the SF bug #1560974. Modified Paths: -------------- trunk/epydoc/src/epydoc/docintrospecter.py Modified: trunk/epydoc/src/epydoc/docintrospecter.py =================================================================== --- trunk/epydoc/src/epydoc/docintrospecter.py 2007-01-29 00:14:38 UTC (rev 1426) +++ trunk/epydoc/src/epydoc/docintrospecter.py 2007-01-29 01:11:49 UTC (rev 1427) @@ -570,7 +570,7 @@ classes; methods of non-nested classes; and some class methods of non-nested classes. - @rtype: L{DottedName} or C{None} + @rtype: L{DottedName} or C{UNKNOWN} """ if not hasattr(value, '__name__'): return UNKNOWN @@ -588,12 +588,12 @@ value.im_class is ClassType and not value.__name__.startswith('<')): # class method. class_name = get_canonical_name(value.im_self) - if class_name is None: return UNKNOWN + if class_name is UNKNOWN: return UNKNOWN dotted_name = DottedName(class_name, value.__name__) elif (inspect.ismethod(value) and not value.__name__.startswith('<')): class_name = get_canonical_name(value.im_class) - if class_name is None: return UNKNOWN + if class_name is UNKNOWN: return UNKNOWN dotted_name = DottedName(class_name, value.__name__) elif (isinstance(value, FunctionType) and not value.__name__.startswith('<')): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-01-29 00:14:39
|
Revision: 1426 http://svn.sourceforge.net/epydoc/?rev=1426&view=rev Author: dvarrazzo Date: 2007-01-28 16:14:38 -0800 (Sun, 28 Jan 2007) Log Message: ----------- - Warning about unknown parameters suppressed if the function couldn't be introspected, e.g. for builtins. Fixes SF bug #1556024. Modified Paths: -------------- trunk/epydoc/src/epydoc/docintrospecter.py trunk/epydoc/src/epydoc/docstringparser.py Modified: trunk/epydoc/src/epydoc/docintrospecter.py =================================================================== --- trunk/epydoc/src/epydoc/docintrospecter.py 2007-01-28 20:58:50 UTC (rev 1425) +++ trunk/epydoc/src/epydoc/docintrospecter.py 2007-01-29 00:14:38 UTC (rev 1426) @@ -435,6 +435,9 @@ else: # [XX] I should probably use UNKNOWN here?? + # dvarrazzo: if '...' is to be changed, also check that + # `docstringparser.process_arg_field()` works correctly. + # See SF bug #1556024. routine_doc.posargs = ['...'] routine_doc.posarg_defaults = [None] routine_doc.kwarg = None Modified: trunk/epydoc/src/epydoc/docstringparser.py =================================================================== --- trunk/epydoc/src/epydoc/docstringparser.py 2007-01-28 20:58:50 UTC (rev 1425) +++ trunk/epydoc/src/epydoc/docstringparser.py 2007-01-29 00:14:38 UTC (rev 1426) @@ -700,9 +700,11 @@ api_doc.arg_descrs.append( (idents, descr) ) # Check to make sure that the documented parameter(s) are # actually part of the function signature. - bad_params = ['"%s"' % i for i in idents if i not in api_doc.all_args()] - if bad_params: - raise ValueError(BAD_PARAM % (tag, ', '.join(bad_params))) + all_args = api_doc.all_args() + if all_args not in (['...'], UNKNOWN): + bad_params = ['"%s"' % i for i in idents if i not in all_args] + if bad_params: + raise ValueError(BAD_PARAM % (tag, ', '.join(bad_params))) def process_kwarg_field(api_doc, docindex, tag, arg, descr): # [xx] these should -not- be checked if they exist.. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-01-28 20:58:52
|
Revision: 1425 http://svn.sourceforge.net/epydoc/?rev=1425&view=rev Author: dvarrazzo Date: 2007-01-28 12:58:50 -0800 (Sun, 28 Jan 2007) Log Message: ----------- - Added an optional 'module_name' parameter to the introspection functions. It can be used to detect the docstring encoding where introspection can't work, such as in properties docstrings. - Encoding properly detected in properties docstrings (SF bug #1631759) Modified Paths: -------------- trunk/epydoc/src/epydoc/docintrospecter.py Modified: trunk/epydoc/src/epydoc/docintrospecter.py =================================================================== --- trunk/epydoc/src/epydoc/docintrospecter.py 2007-01-28 20:20:17 UTC (rev 1424) +++ trunk/epydoc/src/epydoc/docintrospecter.py 2007-01-28 20:58:50 UTC (rev 1425) @@ -64,7 +64,7 @@ ###################################################################### def introspect_docs(value=None, name=None, filename=None, context=None, - is_script=False): + is_script=False, module_name=None): """ Generate the API documentation for a specified object by introspecting Python values, and return it as a L{ValueDoc}. The @@ -85,6 +85,9 @@ documentation for the specified object. @param context: The API documentation for the class of module that contains C{value} (if available). + @param module_name: The name of the module where the value is defined. + Useful to retrieve the docstring encoding if there is no way to + detect the module by introspection (such as in properties) """ if value is None and name is not None and filename is None: value = get_value_from_name(DottedName(name)) @@ -113,7 +116,7 @@ # Introspect the value. _introspected_values[pyid] = True introspect_func = _get_introspecter(value) - introspect_func(value, val_doc) + introspect_func(value, val_doc, module_name=module_name) # Set canonical name, if it was given if val_doc.canonical_name is UNKNOWN and name is not None: @@ -176,7 +179,7 @@ '__builtins__', '__doc__', '__all__', '__file__', '__path__', '__name__', '__extra_epydoc_fields__', '__docformat__') -def introspect_module(module, module_doc, preliminary=False): +def introspect_module(module, module_doc, module_name=None, preliminary=False): """ Add API documentation information about the module C{module} to C{module_doc}. @@ -248,7 +251,8 @@ container = get_containing_module(child) if container is not None and container == module_doc.canonical_name: # Local variable. - child_val_doc = introspect_docs(child, context=module_doc) + child_val_doc = introspect_docs(child, context=module_doc, + module_name=dotted_name) child_var_doc = VariableDoc(name=child_name, value=child_val_doc, is_imported=False, @@ -302,7 +306,7 @@ '__doc__', '__module__', '__dict__', '__weakref__', '__slots__', '__pyx_vtable__') -def introspect_class(cls, class_doc): +def introspect_class(cls, class_doc, module_name=None): """ Add API documentation information about the class C{cls} to C{class_doc}. @@ -372,7 +376,8 @@ if child_name in UNDOCUMENTED_CLASS_VARS: continue #try: child = getattr(cls, child_name) #except: continue - val_doc = introspect_docs(child, context=class_doc) + val_doc = introspect_docs(child, context=class_doc, + module_name=module_name) var_doc = VariableDoc(name=child_name, value=val_doc, container=class_doc, docs_extracted_by='introspecter') @@ -384,7 +389,7 @@ # Routine Introspection #//////////////////////////////////////////////////////////// -def introspect_routine(routine, routine_doc): +def introspect_routine(routine, routine_doc, module_name=None): """Add API documentation information about the function C{routine} to C{routine_doc} (specializing it to C{Routine_doc}).""" routine_doc.specialize_to(RoutineDoc) @@ -447,13 +452,13 @@ # Property Introspection #//////////////////////////////////////////////////////////// -def introspect_property(prop, prop_doc): +def introspect_property(prop, prop_doc, module_name=None): """Add API documentation information about the property C{prop} to C{prop_doc} (specializing it to C{PropertyDoc}).""" prop_doc.specialize_to(PropertyDoc) # Record the property's docstring. - prop_doc.docstring = get_docstring(prop) + prop_doc.docstring = get_docstring(prop, module_name=module_name) # Record the property's access functions. if hasattr(prop, 'fget'): @@ -467,7 +472,7 @@ # Generic Value Introspection #//////////////////////////////////////////////////////////// -def introspect_other(val, val_doc): +def introspect_other(val, val_doc, module_name=None): """Specialize val_doc to a C{GenericValueDoc} and return it.""" val_doc.specialize_to(GenericValueDoc) return val_doc @@ -513,7 +518,7 @@ " may have been changed.") return False -def get_docstring(value): +def get_docstring(value, module_name=None): """ Return the docstring for the given value; or C{None} if it does not have a docstring. @@ -527,7 +532,8 @@ elif isinstance(docstring, str): try: return unicode(docstring, 'ascii') except UnicodeDecodeError: - module_name = get_containing_module(value) + if module_name is None: + module_name = get_containing_module(value) if module_name is not None: try: module = get_value_from_name(module_name) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-01-28 20:20:21
|
Revision: 1424 http://svn.sourceforge.net/epydoc/?rev=1424&view=rev Author: dvarrazzo Date: 2007-01-28 12:20:17 -0800 (Sun, 28 Jan 2007) Log Message: ----------- - Test fixed (probably broken after r1359) Modified Paths: -------------- trunk/epydoc/src/epydoc/test/docparser.doctest Modified: trunk/epydoc/src/epydoc/test/docparser.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/docparser.doctest 2007-01-28 20:14:50 UTC (rev 1423) +++ trunk/epydoc/src/epydoc/test/docparser.doctest 2007-01-28 20:20:17 UTC (rev 1424) @@ -496,7 +496,7 @@ +- f => VariableDoc for test.f [1] +- docstring = <UNKNOWN> +- value - +- ClassMethodDoc [2] + +- ClassMethodDoc for test.f [2] +- docstring = u'docstring for f' +- posargs = [u'cls', u'x'] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-01-28 20:14:56
|
Revision: 1423 http://svn.sourceforge.net/epydoc/?rev=1423&view=rev Author: dvarrazzo Date: 2007-01-28 12:14:50 -0800 (Sun, 28 Jan 2007) Log Message: ----------- - dotgraph directives work again. they were broken probably after the docutils r4667 checkin, where some assertions about directives return values were added. Tested against docutils snapshot 2007-01-28, r4897 Modified Paths: -------------- trunk/epydoc/src/epydoc/markup/restructuredtext.py Modified: trunk/epydoc/src/epydoc/markup/restructuredtext.py =================================================================== --- trunk/epydoc/src/epydoc/markup/restructuredtext.py 2007-01-28 15:31:10 UTC (rev 1422) +++ trunk/epydoc/src/epydoc/markup/restructuredtext.py 2007-01-28 20:14:50 UTC (rev 1423) @@ -669,8 +669,8 @@ """ if arguments: title = arguments[0] else: title = '' - return dotgraph(_construct_digraph, title, options.get('caption'), - '\n'.join(content)) + return [ dotgraph(_construct_digraph, title, options.get('caption'), + '\n'.join(content)) ] digraph_directive.arguments = (0, 1, True) digraph_directive.options = {'caption': directives.unchanged} digraph_directive.content = True @@ -698,7 +698,7 @@ - C{:dir:} -- Specifies the orientation of the graph. One of C{down}, C{right} (default), C{left}, C{up}. """ - return dotgraph(_construct_classtree, arguments, options) + return [ dotgraph(_construct_classtree, arguments, options) ] classtree_directive.arguments = (0, 1, True) classtree_directive.options = {'dir': _dir_option} classtree_directive.content = False @@ -734,7 +734,7 @@ - C{:dir:} -- Specifies the orientation of the graph. One of C{down}, C{right} (default), C{left}, C{up}. """ - return dotgraph(_construct_packagetree, arguments, options) + return [ dotgraph(_construct_packagetree, arguments, options) ] packagetree_directive.arguments = (0, 1, True) packagetree_directive.options = { 'dir': _dir_option, @@ -759,8 +759,7 @@ def importgraph_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): - return dotgraph(_construct_importgraph, arguments, options) -importgraph_directive.arguments = None + return [ dotgraph(_construct_importgraph, arguments, options) ] importgraph_directive.options = {'dir': _dir_option} importgraph_directive.content = False directives.register_directive('importgraph', importgraph_directive) @@ -772,7 +771,7 @@ def callgraph_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): - return dotgraph(_construct_callgraph, arguments, options) + return [ dotgraph(_construct_callgraph, arguments, options) ] callgraph_directive.arguments = (0, 1, True) callgraph_directive.options = {'dir': _dir_option, 'add_callers': directives.flag, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-01-28 15:31:12
|
Revision: 1422 http://svn.sourceforge.net/epydoc/?rev=1422&view=rev Author: dvarrazzo Date: 2007-01-28 07:31:10 -0800 (Sun, 28 Jan 2007) Log Message: ----------- - Oops... this is a branch. Moved into the branches directory. Added Paths: ----------- branches/exp-compact-html/ Removed Paths: ------------- tags/exp-compact-html/ Copied: branches/exp-compact-html (from rev 1421, tags/exp-compact-html) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-01-28 15:23:09
|
Revision: 1421 http://svn.sourceforge.net/epydoc/?rev=1421&view=rev Author: dvarrazzo Date: 2007-01-28 07:23:07 -0800 (Sun, 28 Jan 2007) Log Message: ----------- - Using 'repr()' instead of the backtick operator, which fell in BDFL disgrace. Modified Paths: -------------- trunk/epydoc/src/epydoc/docbuilder.py trunk/epydoc/src/epydoc/docintrospecter.py Modified: trunk/epydoc/src/epydoc/docbuilder.py =================================================================== --- trunk/epydoc/src/epydoc/docbuilder.py 2007-01-28 14:19:30 UTC (rev 1420) +++ trunk/epydoc/src/epydoc/docbuilder.py 2007-01-28 15:23:07 UTC (rev 1421) @@ -283,7 +283,7 @@ def _get_docs_from_pyobject(obj, introspect, parse, progress_estimator): progress_estimator.complete += 1 - log.progress(progress_estimator.progress(), `obj`) + log.progress(progress_estimator.progress(), repr(obj)) if not introspect: log.error("Cannot get docs for Python objects without " Modified: trunk/epydoc/src/epydoc/docintrospecter.py =================================================================== --- trunk/epydoc/src/epydoc/docintrospecter.py 2007-01-28 14:19:30 UTC (rev 1420) +++ trunk/epydoc/src/epydoc/docintrospecter.py 2007-01-28 15:23:07 UTC (rev 1421) @@ -537,7 +537,7 @@ except KeyboardInterrupt: raise except Exception: pass if hasattr(value, '__name__'): name = value.__name__ - else: name = `value` + else: name = repr(value) log.warning("%s's docstring is not a unicode string, but it " "contains non-ascii data -- treating it as " "latin-1." % name) @@ -548,7 +548,7 @@ return None else: if hasattr(value, '__name__'): name = value.__name__ - else: name = `value` + else: name = repr(value) log.warning("%s's docstring is not a string -- ignoring it." % name) return None This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-01-28 14:19:34
|
Revision: 1420 http://svn.sourceforge.net/epydoc/?rev=1420&view=rev Author: dvarrazzo Date: 2007-01-28 06:19:30 -0800 (Sun, 28 Jan 2007) Log Message: ----------- - Fixed nested list generation - now xhtml well formed. Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/html.py Modified: trunk/epydoc/src/epydoc/docwriter/html.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html.py 2007-01-28 13:40:36 UTC (rev 1419) +++ trunk/epydoc/src/epydoc/docwriter/html.py 2007-01-28 14:19:30 UTC (rev 1420) @@ -2650,13 +2650,13 @@ if doc.summary not in (None, UNKNOWN): out(': <em class="summary">'+ self.description(doc.summary, doc, 8)+'</em>') - out('</li>\n') if doc.submodules != UNKNOWN and doc.submodules: - if priv: out(' <ul class="private">\n') - else: out(' <ul>\n') + if priv: out('\n <ul class="private">\n') + else: out('\n <ul>\n') for submodule in doc.submodules: self.write_module_tree_item(out, submodule, package=doc) - out(' </ul>\n </li>\n') + out(' </ul>\n') + out(' </li>\n') #//////////////////////////////////////////////////////////// #{ Class trees This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-01-28 13:40:39
|
Revision: 1419 http://svn.sourceforge.net/epydoc/?rev=1419&view=rev Author: dvarrazzo Date: 2007-01-28 05:40:36 -0800 (Sun, 28 Jan 2007) Log Message: ----------- - Fixed '_find_top_page()' fallback (closes SF bug #1646232) Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/html.py Modified: trunk/epydoc/src/epydoc/docwriter/html.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html.py 2007-01-17 23:45:21 UTC (rev 1418) +++ trunk/epydoc/src/epydoc/docwriter/html.py 2007-01-28 13:40:36 UTC (rev 1419) @@ -457,6 +457,7 @@ # Otherwise, give up. log.warning('Could not find top page %r; using %s ' 'instead' % (pagename, self._trees_url)) + return self._trees_url # If no page name was specified, then try to choose one # automatically. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-01-17 23:45:22
|
Revision: 1418 http://svn.sourceforge.net/epydoc/?rev=1418&view=rev Author: edloper Date: 2007-01-17 15:45:21 -0800 (Wed, 17 Jan 2007) Log Message: ----------- In response to feedback from the folks at scipy, I modified the syntax for consolidated fields slightly. Now, the argument names are no longer required to be marked by backticks. I.e., instead of: :Arguments: `x` : int Description of x... you can now just write: :Arguments: x : int Description of x... Modified Paths: -------------- trunk/epydoc/src/epydoc/markup/restructuredtext.py Modified: trunk/epydoc/src/epydoc/markup/restructuredtext.py =================================================================== --- trunk/epydoc/src/epydoc/markup/restructuredtext.py 2007-01-17 21:41:59 UTC (rev 1417) +++ trunk/epydoc/src/epydoc/markup/restructuredtext.py 2007-01-17 23:45:21 UTC (rev 1418) @@ -314,6 +314,14 @@ @ivar fields: The fields of the most recently walked document. @type fields: C{list} of L{Field<markup.Field>} """ + + ALLOW_UNMARKED_ARG_IN_CONSOLIDATED_FIELD = True + """If true, then consolidated fields are not required to mark + arguments with C{`backticks`}. (This is currently only + implemented for consolidated fields expressed as definition lists; + consolidated fields expressed as unordered lists still require + backticks for now.""" + def __init__(self, document, errors): NodeVisitor.__init__(self, document) self._errors = errors @@ -425,7 +433,7 @@ child = fbody[0][0] if child.data[:1] in ':-': child.data = child.data[1:].lstrip() - elif child.data[:2] == ' -': + elif child.data[:2] in (' -', ' :'): child.data = child.data[2:].lstrip() # Wrap the field body, and add a new field @@ -446,7 +454,9 @@ raise ValueError('bad definition list (bad child %d).' % n) if len(item) > 3: raise ValueError(_BAD_ITEM % n) - if item[0][0].tagname != 'title_reference': + if not ((item[0][0].tagname == 'title_reference') or + (self.ALLOW_UNMARKED_ARG_IN_CONSOLIDATED_FIELD and + isinstance(item[0][0], docutils.nodes.Text))): raise ValueError(_BAD_ITEM % n) for child in item[0][1:]: if child.astext() != '': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-01-17 21:42:01
|
Revision: 1417 http://svn.sourceforge.net/epydoc/?rev=1417&view=rev Author: edloper Date: 2007-01-17 13:41:59 -0800 (Wed, 17 Jan 2007) Log Message: ----------- Fixed typo Modified Paths: -------------- trunk/epydoc/doc/epytextintro.html Modified: trunk/epydoc/doc/epytextintro.html =================================================================== --- trunk/epydoc/doc/epytextintro.html 2007-01-17 21:29:25 UTC (rev 1416) +++ trunk/epydoc/doc/epytextintro.html 2007-01-17 21:41:59 UTC (rev 1417) @@ -10,7 +10,7 @@ <h1> A Brief Introduction to Epytext </h1> <p> Epytext is a simple lightweight markup language that lets you add -formatting and structue to docstrings. Epydoc uses that formatting +formatting and structure to docstrings. Epydoc uses that formatting and structure to produce nicely formatted API documentation. The following example (which has an unusually high ratio of documentaiton to code) illustrates some of the basic features of epytext: </p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-01-17 21:29:28
|
Revision: 1416 http://svn.sourceforge.net/epydoc/?rev=1416&view=rev Author: edloper Date: 2007-01-17 13:29:25 -0800 (Wed, 17 Jan 2007) Log Message: ----------- Removed import of 'sre' (not used, and causes a deprication warning in python 2.5 -- see SF bug #1563688) Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/html_colorize.py Modified: trunk/epydoc/src/epydoc/docwriter/html_colorize.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html_colorize.py 2007-01-17 21:26:37 UTC (rev 1415) +++ trunk/epydoc/src/epydoc/docwriter/html_colorize.py 2007-01-17 21:29:25 UTC (rev 1416) @@ -15,7 +15,7 @@ """ __docformat__ = 'epytext en' -import sys, sre_parse, sre, re, codecs +import sys, sre_parse, re, codecs import sre_constants from epydoc import log from epydoc.util import decode_with_backslashreplace, plaintext_to_html This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-01-17 21:26:39
|
Revision: 1415 http://svn.sourceforge.net/epydoc/?rev=1415&view=rev Author: edloper Date: 2007-01-17 13:26:37 -0800 (Wed, 17 Jan 2007) Log Message: ----------- Changed PYTHON=python2.4 -> PYTHON=python (in response to SF bug #1563688) Modified Paths: -------------- trunk/epydoc/Makefile trunk/epydoc/src/Makefile Modified: trunk/epydoc/Makefile =================================================================== --- trunk/epydoc/Makefile 2007-01-17 21:19:47 UTC (rev 1414) +++ trunk/epydoc/Makefile 2007-01-17 21:26:37 UTC (rev 1415) @@ -16,7 +16,7 @@ DOCTESTS = $(wildcard src/epydoc/test/*.doctest) # What version of python to use? -PYTHON = python2.4 +PYTHON = python # The location of the webpage. HOST = shell.sf.net Modified: trunk/epydoc/src/Makefile =================================================================== --- trunk/epydoc/src/Makefile 2007-01-17 21:19:47 UTC (rev 1414) +++ trunk/epydoc/src/Makefile 2007-01-17 21:26:37 UTC (rev 1415) @@ -14,7 +14,7 @@ DOC = ${LIB}/doc/ # What version of python to use? -PYTHON = python2.4 +PYTHON = python ##////////////////////////////////////////////////////////////////////// ## Makefile This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-01-17 21:19:51
|
Revision: 1414 http://svn.sourceforge.net/epydoc/?rev=1414&view=rev Author: edloper Date: 2007-01-17 13:19:47 -0800 (Wed, 17 Jan 2007) Log Message: ----------- Fixed SF bug #1620947: don't assume that classes define __name__. Modified Paths: -------------- trunk/epydoc/src/epydoc/docintrospecter.py Modified: trunk/epydoc/src/epydoc/docintrospecter.py =================================================================== --- trunk/epydoc/src/epydoc/docintrospecter.py 2007-01-17 20:54:02 UTC (rev 1413) +++ trunk/epydoc/src/epydoc/docintrospecter.py 2007-01-17 21:19:47 UTC (rev 1414) @@ -345,7 +345,7 @@ bases = None log.warning("Class '%s' defines __bases__, but it does not " "contain an iterable; ignoring base list." - % cls.__name__) + % getattr(cls, '__name__', '??')) if bases is not None: class_doc.bases = [] for base in bases: @@ -360,8 +360,8 @@ # Record the class's local variables. class_doc.variables = {} - private_prefix = '_%s__' % cls.__name__ if hasattr(cls, '__dict__'): + private_prefix = '_%s__' % getattr(cls, '__name__', '<none>') for child_name, child in cls.__dict__.items(): if (child_name in base_children and base_children[child_name] == child): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-01-17 20:54:04
|
Revision: 1413 http://svn.sourceforge.net/epydoc/?rev=1413&view=rev Author: edloper Date: 2007-01-17 12:54:02 -0800 (Wed, 17 Jan 2007) Log Message: ----------- Fixed sourceforge bug #1566295: javadoc processing failed if a @raise didn't include a description. Modified Paths: -------------- trunk/epydoc/src/epydoc/markup/javadoc.py Modified: trunk/epydoc/src/epydoc/markup/javadoc.py =================================================================== --- trunk/epydoc/src/epydoc/markup/javadoc.py 2007-01-17 20:43:08 UTC (rev 1412) +++ trunk/epydoc/src/epydoc/markup/javadoc.py 2007-01-17 20:54:02 UTC (rev 1413) @@ -129,7 +129,8 @@ else: # Get the field argument (if appropriate). if tag in self._ARG_FIELDS: - (arg, body) = pieces[i].strip().split(None, 1) + subpieces = pieces[i].strip().split(None, 1)+['',''] + (arg, body) = subpieces[:2] else: (arg, body) = (None, pieces[i]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |