Rev 2566: (John Arbash Meinel) Improve 'make api-docs' output. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Jun 29 16:01:47 BST 2007


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 2566
revision-id: pqm at pqm.ubuntu.com-20070629150144-xoeghcfb52pit8tv
parent: pqm at pqm.ubuntu.com-20070629060700-wou1v3btg9otmum4
parent: john at arbash-meinel.com-20070628231809-pqbt7puoqj8bl07b
committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2007-06-29 16:01:44 +0100
message:
  (John Arbash Meinel) Improve 'make api-docs' output.
modified:
  bzrlib/add.py                  add.py-20050323030017-3a77d63feda58e33
  bzrlib/benchmarks/__init__.py  __init__.py-20060516064526-eb0d37c78e86065d
  bzrlib/benchmarks/bench_add.py bench_add.py-20060516064526-6342399b2967266c
  bzrlib/benchmarks/bench_bench.py bench_bench.py-20060609084943-2lv2wsi61vhkmj7b-1
  bzrlib/benchmarks/bench_cache_utf8.py bench_encoding.py-20060810000746-nv69wfkxei7w2cij-1
  bzrlib/benchmarks/bench_checkout.py bench_checkout.py-20060521233052-b52eba18ee46046b
  bzrlib/benchmarks/bench_commit.py bench_commit.py-20060522031508-4ea2551904e4becb
  bzrlib/benchmarks/bench_inventory.py bench_inventory.py-20060611112709-gjo1kx0oudyo9qbv-1
  bzrlib/benchmarks/bench_log.py bench_log.py-20060611214524-mr18tk29h8v0qb4x-1
  bzrlib/benchmarks/bench_osutils.py bench_osutils.py-20060608153714-apso8cyz1bu2z1ig-1
  bzrlib/benchmarks/bench_rocks.py bench_rocks.py-20060608120339-3ydxl3v2cori44zb-1
  bzrlib/benchmarks/bench_sftp.py bench_sftp.py-20060810114659-67c1edb27503ebde
  bzrlib/benchmarks/bench_startup.py bench_startup.py-20061006075337-q49on3zvfcbvarn3-1
  bzrlib/benchmarks/bench_status.py bench_status.py-20060520215801-2cc60f6da5625927
  bzrlib/benchmarks/bench_transform.py bench_transform.py-20060525041052-ysn0hlw94gcc57lm-1
  bzrlib/benchmarks/bench_workingtree.py bench_workingtree.py-20060527061822-cxrgsa9ax2q4d82q-1
  bzrlib/benchmarks/bench_xml.py bench_xml.py-20060816202544-ty0p415bb7om5gzd-1
  bzrlib/benchmarks/tree_creator/kernel_like.py kernel_like.py-20060815024128-b16a7pn542u6b13k-1
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
    ------------------------------------------------------------
    revno: 2399.1.17
    merged: john at arbash-meinel.com-20070628231809-pqbt7puoqj8bl07b
    parent: john at arbash-meinel.com-20070428150417-trp3pi0pzd411pu4
    parent: pqm at pqm.ubuntu.com-20070628194410-pikmj08nsn9sci9h
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Thu 2007-06-28 18:18:09 -0500
    message:
      [merge] bzr.dev 2562
    ------------------------------------------------------------
    revno: 2399.1.16
    merged: john at arbash-meinel.com-20070428150417-trp3pi0pzd411pu4
    parent: john at arbash-meinel.com-20070412213307-kuh07cnzaud12wx1
    parent: pqm at pqm.ubuntu.com-20070426211103-h84prqh7a4ad3ez2
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Sat 2007-04-28 10:04:17 -0500
    message:
      [merge] bzr.dev 2466
    ------------------------------------------------------------
    revno: 2399.1.15
    merged: john at arbash-meinel.com-20070412213307-kuh07cnzaud12wx1
    parent: john at arbash-meinel.com-20070412203640-z1jld315288moxvy
    parent: john at arbash-meinel.com-20070412202742-4cr2qmchdfe9mg7n
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Thu 2007-04-12 16:33:07 -0500
    message:
      [merge] api-doc-builder and remove the pydoctor build code for now.
    ------------------------------------------------------------
    revno: 2399.1.14
    merged: john at arbash-meinel.com-20070412203640-z1jld315288moxvy
    parent: john at arbash-meinel.com-20070412194551-r4m6wdhhgz6353sq
    parent: pqm at pqm.ubuntu.com-20070412150356-jeie6iap22sae8xf
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Thu 2007-04-12 15:36:40 -0500
    message:
      [merge] bzr.dev 2413
    ------------------------------------------------------------
    revno: 2399.1.13
    merged: john at arbash-meinel.com-20070412194551-r4m6wdhhgz6353sq
    parent: john at arbash-meinel.com-20070412193210-ljgiw2au2r7ttx53
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Thu 2007-04-12 14:45:51 -0500
    message:
      Remove BRANCH.TODO info, now that we have make check-api-doc
    ------------------------------------------------------------
    revno: 2399.1.12
    merged: john at arbash-meinel.com-20070412193210-ljgiw2au2r7ttx53
    parent: john at arbash-meinel.com-20070412190236-9izxi311ng5zofvh
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Thu 2007-04-12 14:32:10 -0500
    message:
      Add make check-api-docs, which runs epydoc --check, rather than generating output
    ------------------------------------------------------------
    revno: 2399.1.11
    merged: john at arbash-meinel.com-20070412190236-9izxi311ng5zofvh
    parent: john at arbash-meinel.com-20070412184551-3v8sc4zdlrxdb202
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Thu 2007-04-12 14:02:36 -0500
    message:
      Update lazy_import with tests for the new '_should_proxy' variable.
    ------------------------------------------------------------
    revno: 2399.1.10
    merged: john at arbash-meinel.com-20070412184551-3v8sc4zdlrxdb202
    parent: john at arbash-meinel.com-20070412174910-4m93s90gq6tjk1k4
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Thu 2007-04-12 13:45:51 -0500
    message:
      fix assertRaises to use the right parameter...
    ------------------------------------------------------------
    revno: 2399.1.9
    merged: john at arbash-meinel.com-20070412174910-4m93s90gq6tjk1k4
    parent: john at arbash-meinel.com-20070409231939-prjmbgzw9fj3zqon
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Thu 2007-04-12 12:49:10 -0500
    message:
      Since I have epydoc working with lazy imports, make it the default api doc generator.
      Also, update Makefile to make it easier to just document one file.
    ------------------------------------------------------------
    revno: 2399.1.8
    merged: john at arbash-meinel.com-20070409231939-prjmbgzw9fj3zqon
    parent: john at arbash-meinel.com-20070409221122-qh66j4pk3kqxjn9c
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Mon 2007-04-09 18:19:39 -0500
    message:
      Change lazy_import to allow proxying when necessary.
      Write a monkey-patch for epydoc.uid.ObjectUID so that it can understand
      a lazy_import object.
      With the monkey-patch in place, epydoc seems to be able to process bzrlib.
      Now we still need to fix the errors. :)
    ------------------------------------------------------------
    revno: 2399.1.7
    merged: john at arbash-meinel.com-20070409221122-qh66j4pk3kqxjn9c
    parent: john at arbash-meinel.com-20070409212132-23n1qlamaypsbluo
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Mon 2007-04-09 17:11:22 -0500
    message:
      Cleanup bzrlib/benchmarks/* so that everything at least has a valid doc string.
    ------------------------------------------------------------
    revno: 2399.1.6
    merged: john at arbash-meinel.com-20070409212132-23n1qlamaypsbluo
    parent: john at arbash-meinel.com-20070409210631-llhncalt7gct9wms
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Mon 2007-04-09 16:21:32 -0500
    message:
      Cleanup bzrlib/tests/__init__.py so that epydoc doesn't complain.
    ------------------------------------------------------------
    revno: 2399.1.5
    merged: john at arbash-meinel.com-20070409210631-llhncalt7gct9wms
    parent: john at arbash-meinel.com-20070409210437-qdyadcg1orpe5kkh
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Mon 2007-04-09 16:06:31 -0500
    message:
      Clean up add.py documentation.
      Add doc strings for undocumented functions.
      Move documentation to the right location for 'smart_add_tree'
      Fix rst documentation (the lines need to be indented for each parameter)
    ------------------------------------------------------------
    revno: 2399.1.4
    merged: john at arbash-meinel.com-20070409210437-qdyadcg1orpe5kkh
    parent: john at arbash-meinel.com-20070409203609-xpvz574u8jj10q36
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Mon 2007-04-09 16:04:37 -0500
    message:
      Add command line invocations for epydoc and pydoctor to generate docs
      for a single file.
    ------------------------------------------------------------
    revno: 2399.1.3
    merged: john at arbash-meinel.com-20070409203609-xpvz574u8jj10q36
    parent: john at arbash-meinel.com-20070409203546-7935oty2xm5mj4j8
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Mon 2007-04-09 15:36:09 -0500
    message:
      Add a list of documentation failures
    ------------------------------------------------------------
    revno: 2399.1.2
    merged: john at arbash-meinel.com-20070409203546-7935oty2xm5mj4j8
    parent: john at arbash-meinel.com-20070409202547-d2g38oke516pzbin
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Mon 2007-04-09 15:35:46 -0500
    message:
      Add url to bazaar project page in docs
    ------------------------------------------------------------
    revno: 2399.1.1
    merged: john at arbash-meinel.com-20070409202547-d2g38oke516pzbin
    parent: pqm at pqm.ubuntu.com-20070404140524-48cdc6512763399e
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: doc-cleanup
    timestamp: Mon 2007-04-09 15:25:47 -0500
    message:
      Update Makefile to add 'make api-docs' using pydoctor
=== modified file 'bzrlib/add.py'
--- a/bzrlib/add.py	2007-03-07 03:09:14 +0000
+++ b/bzrlib/add.py	2007-04-09 21:06:31 +0000
@@ -14,6 +14,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+"""Helper functions for adding files to working trees."""
+
 import errno
 import os
 from os.path import dirname
@@ -29,13 +31,21 @@
 
 
 def glob_expand_for_win32(file_list):
+    """Replacement for glob expansion by the shell.
+
+    Win32's cmd.exe does not do glob expansion (eg ``*.py``), so we do our own
+    here.
+
+    :param file_list: A list of filenames which may include shell globs.
+    :return: An expanded list of filenames.
+    """
     if not file_list:
         return
     import glob
     expanded_file_list = []
     for possible_glob in file_list:
         glob_files = glob.glob(possible_glob)
-       
+
         if glob_files == []:
             # special case to let the normal code path handle
             # files that do not exists
@@ -59,6 +69,12 @@
     """A class which defines what action to take when adding a file."""
 
     def __init__(self, to_file=None, should_print=None):
+        """Initialize an action which prints added files to an output stream.
+
+        :param to_file: The stream to write into. This is expected to take
+            Unicode paths. If not supplied, it will default to ``sys.stdout``.
+        :param should_print: If False, printing will be supressed.
+        """
         self._to_file = to_file
         if to_file is None:
             self._to_file = sys.stdout
@@ -169,6 +185,21 @@
 
 
 def smart_add_tree(tree, file_list, recurse=True, action=None, save=True):
+    """Add files to version, optionally recursing into directories.
+
+    This is designed more towards DWIM for humans than API simplicity.
+    For the specific behaviour see the help for cmd_add().
+
+    This calls reporter with each (path, kind, file_id) of added files.
+
+    Returns the number of files added.
+
+    :param save: Save the inventory after completing the adds. If False this
+        provides dry-run functionality by doing the add and not saving the
+        inventory.  Note that the modified inventory is left in place, allowing
+        further dry-run tasks to take place. To restore the original inventory
+        call tree.read_working_inventory().
+    """
     tree.lock_tree_write()
     try:
         return _smart_add_tree(tree=tree, file_list=file_list, recurse=recurse,
@@ -176,21 +207,12 @@
     finally:
         tree.unlock()
 
+
 def _smart_add_tree(tree, file_list, recurse=True, action=None, save=True):
-    """Add files to version, optionally recursing into directories.
-
-    This is designed more towards DWIM for humans than API simplicity.
-    For the specific behaviour see the help for cmd_add().
-
-    This calls reporter with each (path, kind, file_id) of added files.
-
-    Returns the number of files added.
-    
-    :param save: Save the inventory after completing the adds. If False this
-    provides dry-run functionality by doing the add and not saving the
-    inventory.  Note that the modified inventory is left in place, allowing 
-    further dry-run tasks to take place. To restore the original inventory
-    call tree.read_working_inventory().
+    """Helper for smart_add_tree.
+
+    The tree should be locked before entering this function. See smart_add_tree
+    for parameter definitions.
     """
     assert isinstance(recurse, bool)
     if action is None:
@@ -347,11 +369,11 @@
 
     :param inv: Inventory which will receive the new entry.
     :param parent_ie: Parent inventory entry if known, or None.  If
-    None, the parent is looked up by name and used if present, otherwise
-    it is recursively added.
+        None, the parent is looked up by name and used if present, otherwise it
+        is recursively added.
     :param kind: Kind of new entry (file, directory, etc)
     :param action: callback(inv, parent_ie, path, kind); return ignored.
-    :returns: A list of paths which have been added.
+    :return: A list of paths which have been added.
     """
     # Nothing to do if path is already versioned.
     # This is safe from infinite recursion because the tree root is

=== modified file 'bzrlib/benchmarks/__init__.py'
--- a/bzrlib/benchmarks/__init__.py	2006-10-16 01:25:46 +0000
+++ b/bzrlib/benchmarks/__init__.py	2007-04-09 22:11:22 +0000
@@ -26,16 +26,19 @@
 
 
 class Benchmark(ExternalBase):
+    """A Test class which provides helpers for writing benchmark tests."""
 
     def make_kernel_like_tree(self, url=None, root='.',
                               link_working=False):
         """Setup a temporary tree roughly like a kernel tree.
-        
+
         :param url: Creat the kernel like tree as a lightweight checkout
-        of a new branch created at url.
+            of a new branch created at url.
+        :param root: Path where the tree will be created.
         :param link_working: instead of creating a new copy of all files
             just hardlink the working tree. Tests must request this, because
             they must break links if they want to change the files
+        :return: A newly created tree.
         """
         from bzrlib.benchmarks.tree_creator.kernel_like import (
             KernelLikeTreeCreator,
@@ -131,7 +134,7 @@
                             hardlink=False):
         """Create a tree with many files and many commits. Every commit changes
         exactly one file.
-        
+
         :param num_files: number of files to be created
         :param num_commits: number of commits in the newly created tree
         """
@@ -153,8 +156,8 @@
         :param tree: The tree in which the changes happen.
         :param files: The list of files where changes should occur.
         :param num_commits: The number of commits
-        :param changes_per_commit: The number of files that are touched in 
-        each commit.
+        :param changes_per_commit: The number of files that are touched in
+            each commit.
         """
         for j in range(num_commits):
             for i in range(changes_per_commit):

=== modified file 'bzrlib/benchmarks/bench_add.py'
--- a/bzrlib/benchmarks/bench_add.py	2006-10-11 23:08:27 +0000
+++ b/bzrlib/benchmarks/bench_add.py	2007-04-09 22:11:22 +0000
@@ -21,6 +21,7 @@
 
 
 class AddBenchmark(Benchmark):
+    """Benchmarks for 'bzr add'"""
 
     def test_one_add_kernel_like_tree(self):
         """Adding a kernel sized tree should be bearable (<5secs) fast.""" 

=== modified file 'bzrlib/benchmarks/bench_bench.py'
--- a/bzrlib/benchmarks/bench_bench.py	2006-10-11 23:08:27 +0000
+++ b/bzrlib/benchmarks/bench_bench.py	2007-04-09 22:11:22 +0000
@@ -29,6 +29,7 @@
 
 
 class MakeKernelLikeTreeBenchmark(Benchmark):
+    """Benchmark creating benchmark trees."""
 
     def test_make_kernel_like_tree(self):
         """Making a kernel sized tree should be ~ 5seconds on modern disk.""" 

=== modified file 'bzrlib/benchmarks/bench_cache_utf8.py'
--- a/bzrlib/benchmarks/bench_cache_utf8.py	2006-11-28 16:00:17 +0000
+++ b/bzrlib/benchmarks/bench_cache_utf8.py	2007-04-09 22:11:22 +0000
@@ -35,6 +35,7 @@
 
 
 class EncodingBenchmark(Benchmark):
+    """Benchmark the time to encode strings."""
 
     def setUp(self):
         super(EncodingBenchmark, self).setUp()
@@ -134,7 +135,9 @@
                      unicode("%07d" % x) for x in xrange(500000)]
         self.time(self.encode_cached_multi, revisions, 1)
 
+
 class DecodingBenchmarks(Benchmark):
+    """Benchmark the time to decode strings."""
 
     def setUp(self):
         super(DecodingBenchmarks, self).setUp()

=== modified file 'bzrlib/benchmarks/bench_checkout.py'
--- a/bzrlib/benchmarks/bench_checkout.py	2006-10-11 23:08:27 +0000
+++ b/bzrlib/benchmarks/bench_checkout.py	2007-04-09 22:11:22 +0000
@@ -21,6 +21,7 @@
 
 
 class CheckoutBenchmark(Benchmark):
+    """Benchmarks for ``'bzr checkout'`` performance."""
 
     def test_build_kernel_like_tree(self):
         """Checkout of a clean kernel sized tree should be (<10secs)."""

=== modified file 'bzrlib/benchmarks/bench_commit.py'
--- a/bzrlib/benchmarks/bench_commit.py	2006-10-16 01:25:46 +0000
+++ b/bzrlib/benchmarks/bench_commit.py	2007-04-09 22:11:22 +0000
@@ -24,6 +24,7 @@
 
 
 class CommitBenchmark(Benchmark):
+    """Benchmarks for ``bzr commit``"""
 
     def test_commit_kernel_like_tree(self):
         """Commit of a fresh import of a clean kernel sized tree."""

=== modified file 'bzrlib/benchmarks/bench_inventory.py'
--- a/bzrlib/benchmarks/bench_inventory.py	2006-10-11 23:08:27 +0000
+++ b/bzrlib/benchmarks/bench_inventory.py	2007-04-09 22:11:22 +0000
@@ -14,14 +14,15 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-"""Tests for bzr add performance."""
-
-
-import bzrlib
+"""Tests for `bzrlib.inventory.Inventory` performance."""
+
+
+import bzrlib.inventory
 from bzrlib.benchmarks import Benchmark
 
 
 class InvBenchmark(Benchmark):
+    """Benchmarks for building large inventories."""
 
     def test_make_10824_inv_entries(self):
         """Making 10824 inv entries should be quick."""

=== modified file 'bzrlib/benchmarks/bench_log.py'
--- a/bzrlib/benchmarks/bench_log.py	2006-10-11 23:08:27 +0000
+++ b/bzrlib/benchmarks/bench_log.py	2007-04-09 22:11:22 +0000
@@ -26,24 +26,45 @@
 from bzrlib.transform import TreeTransform
 from bzrlib.workingtree import WorkingTree
 
+
 class LinesDone(Exception):
+    """Raised when `LineConsumer` reaches the required number of lines."""
     pass
 
+
 class LineConsumer(object):
+    """Count lines that are produced.
+
+    When the required number of lines have been reached, raise `LinesDone`.
+    """
 
     def __init__(self, required_lines):
+        """Create a new consumer.
+
+        :param required_lines: How many lines must be produced.
+        :type required_lines: integer
+        """
         self.required_lines = required_lines
 
     def write(self, text):
+        """Write some text to the black hole.
+
+        But count how many lines have been written.
+
+        :param text: A string that would be written.
+        :raise LinesDone: when the required number of lines has been reached.
+        :return: None
+        """
         self.required_lines -= text.count('\n')
         if self.required_lines < 0:
             raise LinesDone()
-        
+
 
 class LogBenchmark(Benchmark):
+    """Benchmarks for ``'bzr log'`` performance."""
 
     def test_log(self):
-        """Run log in a many-commit tree.""" 
+        """Run log in a many-commit tree."""
         tree = self.make_many_commit_tree(hardlink=True)
         lf = log_formatter('long', to_file=StringIO())
         self.time(show_log, tree.branch, lf, direction='reverse')

=== modified file 'bzrlib/benchmarks/bench_osutils.py'
--- a/bzrlib/benchmarks/bench_osutils.py	2006-10-11 23:08:27 +0000
+++ b/bzrlib/benchmarks/bench_osutils.py	2007-04-09 22:11:22 +0000
@@ -22,6 +22,7 @@
 
 
 class WalkDirsBenchmark(Benchmark):
+    """Benchmarks for `bzrlib.osutils.walkdirs`"""
 
     def test_walkdirs_kernel_like_tree(self):
         """Walking a kernel sized tree is fast!(150ms)."""

=== modified file 'bzrlib/benchmarks/bench_rocks.py'
--- a/bzrlib/benchmarks/bench_rocks.py	2006-10-16 01:25:46 +0000
+++ b/bzrlib/benchmarks/bench_rocks.py	2007-04-09 22:11:22 +0000
@@ -21,6 +21,7 @@
 
 
 class RocksBenchmark(Benchmark):
+    """Benchmarks for ``'bzr rocks'``"""
 
     def test_rocks(self):
         """Test the startup overhead by running a do-nothing command"""

=== modified file 'bzrlib/benchmarks/bench_sftp.py'
--- a/bzrlib/benchmarks/bench_sftp.py	2006-10-11 23:08:27 +0000
+++ b/bzrlib/benchmarks/bench_sftp.py	2007-04-09 22:11:22 +0000
@@ -93,6 +93,8 @@
 
 
 class SFTPSlowSocketBenchmark(SFTPBenchmark):
+    """Benchmarks of SFTP performance with a 30ms delay per roundtrip."""
+
     def setUp(self):
         super(SFTPSlowSocketBenchmark, self).setUp()
         self.get_server().add_latency = 0.03

=== modified file 'bzrlib/benchmarks/bench_startup.py'
--- a/bzrlib/benchmarks/bench_startup.py	2006-10-16 01:25:46 +0000
+++ b/bzrlib/benchmarks/bench_startup.py	2007-04-09 22:11:22 +0000
@@ -21,6 +21,7 @@
 
 
 class StartupBenchmark(Benchmark):
+    """Benchmark startup costs for certain bzr commands."""
 
     def make_simple_tree(self):
         """A small, simple tree. No caching needed"""

=== modified file 'bzrlib/benchmarks/bench_status.py'
--- a/bzrlib/benchmarks/bench_status.py	2007-02-02 04:53:48 +0000
+++ b/bzrlib/benchmarks/bench_status.py	2007-04-09 22:11:22 +0000
@@ -21,6 +21,7 @@
 
 
 class StatusBenchmark(Benchmark):
+    """Benchmarks for ``'bzr status'``."""
 
     def test_no_ignored_unknown_kernel_like_tree(self):
         """Status in a kernel sized tree with no ignored or unknowns.

=== modified file 'bzrlib/benchmarks/bench_transform.py'
--- a/bzrlib/benchmarks/bench_transform.py	2006-10-11 23:08:27 +0000
+++ b/bzrlib/benchmarks/bench_transform.py	2007-04-09 22:11:22 +0000
@@ -23,7 +23,9 @@
 from bzrlib.transform import TreeTransform
 from bzrlib.workingtree import WorkingTree
 
+
 class TransformBenchmark(Benchmark):
+    """Benchmarks for `bzrlib.transform`"""
 
     def test_canonicalize_path(self):
         """Canonicalizing paths should be fast.""" 

=== modified file 'bzrlib/benchmarks/bench_workingtree.py'
--- a/bzrlib/benchmarks/bench_workingtree.py	2007-02-15 18:32:24 +0000
+++ b/bzrlib/benchmarks/bench_workingtree.py	2007-04-09 22:11:22 +0000
@@ -24,6 +24,7 @@
 
 
 class WorkingTreeBenchmark(Benchmark):
+    """Benchmarks for `bzrlib.workingtree` performance."""
 
     def test_list_files_kernel_like_tree(self):
         tree = self.make_kernel_like_added_tree()

=== modified file 'bzrlib/benchmarks/bench_xml.py'
--- a/bzrlib/benchmarks/bench_xml.py	2006-10-11 23:08:27 +0000
+++ b/bzrlib/benchmarks/bench_xml.py	2007-04-09 22:11:22 +0000
@@ -24,6 +24,7 @@
 
 
 class BenchXMLSerializer(Benchmark):
+    """Benchmarks for serializing to/from XML."""
 
     def test_write_to_string_kernel_like_inventory(self):
         # On jam's machine, ElementTree serializer took: 2161ms/13487ms

=== modified file 'bzrlib/benchmarks/tree_creator/kernel_like.py'
--- a/bzrlib/benchmarks/tree_creator/kernel_like.py	2006-10-11 23:08:27 +0000
+++ b/bzrlib/benchmarks/tree_creator/kernel_like.py	2007-04-09 22:11:22 +0000
@@ -31,7 +31,7 @@
 
 
 class KernelLikeTreeCreator(TreeCreator):
-    """Create a basic tree with ~10k unversioned files""" 
+    """Create a basic tree with ~10k unversioned files"""
 
     def __init__(self, test, link_working=False, url=None):
         super(KernelLikeTreeCreator, self).__init__(test,
@@ -97,6 +97,7 @@
 
 
 class KernelLikeAddedTreeCreator(TreeCreator):
+    """Create a tree with ~10k versioned but not committed files"""
 
     def __init__(self, test, link_working=False, hot_cache=True):
         super(KernelLikeAddedTreeCreator, self).__init__(test,
@@ -188,11 +189,14 @@
         finally:
             f.close()
 
-    def create(self):
+    def create(self, root=None):
         """Create a kernel like inventory
 
+        :param root: Exists to mimic the base class, but this class
+            returns only an in-memory Inventory, so it should always be None.
         :return: An Inventory object.
         """
+        assert root is None, "Cannot create a memory inventory in a on disk."
         cache_dir = self._get_cache_dir()
         if cache_dir is None:
             return self._create_and_return()

=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2007-06-29 05:34:31 +0000
+++ b/bzrlib/tests/__init__.py	2007-06-29 15:01:44 +0000
@@ -884,16 +884,18 @@
                 excName = str(excClass)
             raise self.failureException, "%s not raised" % excName
 
-    def assertRaises(self, excClass, func, *args, **kwargs):
+    def assertRaises(self, excClass, callableObj, *args, **kwargs):
         """Assert that a callable raises a particular exception.
 
         :param excClass: As for the except statement, this may be either an
-        exception class, or a tuple of classes.
+            exception class, or a tuple of classes.
+        :param callableObj: A callable, will be passed ``*args`` and
+            ``**kwargs``.
 
         Returns the exception so that you can examine it.
         """
         try:
-            func(*args, **kwargs)
+            callableObj(*args, **kwargs)
         except excClass, e:
             return e
         else:
@@ -978,7 +980,7 @@
         :param args: The positional arguments for the callable
         :param kwargs: The keyword arguments for the callable
         :return: A tuple (warnings, result). result is the result of calling
-            a_callable(*args, **kwargs).
+            a_callable(``*args``, ``**kwargs``).
         """
         local_warnings = []
         def capture_warnings(msg, cls=None, stacklevel=None):
@@ -1001,15 +1003,16 @@
         not other callers that go direct to the warning module.
 
         :param deprecation_format: The deprecation format that the callable
-            should have been deprecated with. This is the same type as the 
-            parameter to deprecated_method/deprecated_function. If the 
+            should have been deprecated with. This is the same type as the
+            parameter to deprecated_method/deprecated_function. If the
             callable is not deprecated with this format, an assertion error
             will be raised.
         :param a_callable: A callable to call. This may be a bound method or
-            a regular function. It will be called with *args and **kwargs.
+            a regular function. It will be called with ``*args`` and
+            ``**kwargs``.
         :param args: The positional arguments for the callable
         :param kwargs: The keyword arguments for the callable
-        :return: The result of a_callable(*args, **kwargs)
+        :return: The result of a_callable(``*args``, ``**kwargs``)
         """
         call_warnings, result = self._capture_warnings(a_callable,
             *args, **kwargs)
@@ -1327,12 +1330,15 @@
         overall behavior of the bzr application (rather than a unit test
         or a functional test of the library.)
 
-        :param stdin: A string to be used as stdin for the command.
-        :param retcode: The status code the command should return; 
+        This sends the stdout/stderr results into the test's log,
+        where it may be useful for debugging.  See also run_captured.
+
+        :keyword stdin: A string to be used as stdin for the command.
+        :keyword retcode: The status code the command should return;
             default 0.
-        :param working_dir: The directory to run the command in
-        :param error_regexes: A list of expected error messages.  If 
-        specified they must be seen in the error output of the command.
+        :keyword working_dir: The directory to run the command in
+        :keyword error_regexes: A list of expected error messages.  If
+            specified they must be seen in the error output of the command.
         """
         retcode = kwargs.pop('retcode', 0)
         encoding = kwargs.pop('encoding', None)
@@ -1368,18 +1374,19 @@
 
     def run_bzr_error(self, error_regexes, *args, **kwargs):
         """Run bzr, and check that stderr contains the supplied regexes
-        
-        :param error_regexes: Sequence of regular expressions which 
+
+        :param error_regexes: Sequence of regular expressions which
             must each be found in the error output. The relative ordering
             is not enforced.
         :param args: command-line arguments for bzr
         :param kwargs: Keyword arguments which are interpreted by run_bzr
             This function changes the default value of retcode to be 3,
             since in most cases this is run when you expect bzr to fail.
-        :return: (out, err) The actual output of running the command (in case you
-                 want to do more inspection)
-
-        Examples of use:
+        :return: (out, err) The actual output of running the command (in case
+            you want to do more inspection)
+
+        Examples of use::
+
             # Make sure that commit is failing because there is nothing to do
             self.run_bzr_error(['no changes to commit'],
                                'commit', '-m', 'my commit comment')
@@ -1402,14 +1409,14 @@
         handling, or early startup code, etc.  Subprocess code can't be 
         profiled or debugged so easily.
 
-        :param retcode: The status code that is expected.  Defaults to 0.  If
+        :keyword retcode: The status code that is expected.  Defaults to 0.  If
             None is supplied, the status code is not checked.
-        :param env_changes: A dictionary which lists changes to environment
+        :keyword env_changes: A dictionary which lists changes to environment
             variables. A value of None will unset the env variable.
             The values must be strings. The change will only occur in the
             child, so you don't need to fix the environment after running.
-        :param universal_newlines: Convert CRLF => LF
-        :param allow_plugins: By default the subprocess is run with
+        :keyword universal_newlines: Convert CRLF => LF
+        :keyword allow_plugins: By default the subprocess is run with
             --no-plugins to ensure test reproducibility. Also, it is possible
             for system-wide plugins to create unexpected output on stderr,
             which can cause unnecessary test failures.
@@ -1439,7 +1446,7 @@
         profiled or debugged so easily.
 
         :param process_args: a list of arguments to pass to the bzr executable,
-            for example `['--version']`.
+            for example ``['--version']``.
         :param env_changes: A dictionary which lists changes to environment
             variables. A value of None will unset the env variable.
             The values must be strings. The change will only occur in the
@@ -1765,11 +1772,12 @@
         capabilities of the local filesystem, but it might actually be a
         MemoryTransport or some other similar virtual filesystem.
 
-        This is the backing transport (if any) of the server returned by 
+        This is the backing transport (if any) of the server returned by
         get_url and get_readonly_url.
 
         :param relpath: provides for clients to get a path relative to the base
             url.  These should only be downwards relative, not upwards.
+        :return: A URL
         """
         base = self.get_vfs_only_server().get_url()
         return self._adjust_url(base, relpath)
@@ -1923,14 +1931,13 @@
         This assumes that all the elements in the tree being built are new.
 
         This doesn't add anything to a branch.
+
         :param line_endings: Either 'binary' or 'native'
-                             in binary mode, exact contents are written
-                             in native mode, the line endings match the
-                             default platform endings.
-
-        :param transport: A transport to write to, for building trees on 
-                          VFS's. If the transport is readonly or None,
-                          "." is opened automatically.
+            in binary mode, exact contents are written in native mode, the
+            line endings match the default platform endings.
+        :param transport: A transport to write to, for building trees on VFS's.
+            If the transport is readonly or None, "." is opened automatically.
+        :return: None
         """
         # It's OK to just create them using forward slashes on windows.
         if transport is None or transport.is_readonly():




More information about the bazaar-commits mailing list