Added docstrings to libbe submodules.
authorW. Trevor King <wking@drexel.edu>
Mon, 31 Aug 2009 18:19:40 +0000 (14:19 -0400)
committerW. Trevor King <wking@drexel.edu>
Mon, 31 Aug 2009 18:19:40 +0000 (14:19 -0400)
Also a few minor tweaks to the module imports.

21 files changed:
.be/bugs/764b812f-a0bb-4f4d-8e2f-c255c9474a0e/values
Makefile
libbe/arch.py
libbe/beuuid.py
libbe/bug.py
libbe/bugdir.py
libbe/bzr.py
libbe/cmdutil.py
libbe/comment.py
libbe/config.py
libbe/darcs.py
libbe/diff.py
libbe/editor.py
libbe/encoding.py
libbe/git.py
libbe/hg.py
libbe/mapfile.py
libbe/plugin.py
libbe/tree.py
libbe/utility.py
libbe/vcs.py

index 631d1d66b28ac089e948b0788366836c60d2b379..4406356d850d0c232a03fe68faa5ae7663278694 100644 (file)
@@ -7,7 +7,7 @@ reporter: W. Trevor King <wking@drexel.edu>
 severity: minor
 
 
-status: open
+status: fixed
 
 
 summary: Add docstrings explaining role of the libbe submodules.
index fe482c33b82f3653fc81579ad3739aa961031fa2..61f67c82071f8bf8521889607705f8a0e2996129 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -38,8 +38,8 @@ MODULES += ${DOC_DIR}
 
 RM = rm
 
-#PREFIX = /usr/local
-PREFIX = ${HOME}
+PREFIX = /usr/local
+#PREFIX = ${HOME}
 INSTALL_OPTIONS = "--prefix=${PREFIX}"
 
 \f
index b68d732dbc534b655a3f7b4bf099c9e1e064338c..ab551729da670de122e9de31f91bd155710a095b 100644 (file)
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+"""
+GNU Arch (tla) backend.
+"""
+
 import codecs
 import os
 import re
@@ -26,10 +30,11 @@ import time
 import unittest
 import doctest
 
-import config
 from beuuid import uuid_gen
+import config
 import vcs
-from vcs import VCS
+
+
 
 DEFAULT_CLIENT = "tla"
 
@@ -38,7 +43,7 @@ client = config.get_val("arch_client", default=DEFAULT_CLIENT)
 def new():
     return Arch()
 
-class Arch(VCS):
+class Arch(vcs.VCS):
     name = "Arch"
     client = client
     versioned = True
@@ -246,7 +251,7 @@ class Arch(VCS):
         pass
     def _vcs_get_file_contents(self, path, revision=None, binary=False):
         if revision == None:
-            return VCS._vcs_get_file_contents(self, path, revision, binary=binary)
+            return vcs.VCS._vcs_get_file_contents(self, path, revision, binary=binary)
         else:
             status,output,error = \
                 self._invoke_client("file-find", path, revision)
@@ -258,7 +263,7 @@ class Arch(VCS):
             return contents
     def _vcs_duplicate_repo(self, directory, revision=None):
         if revision == None:
-            VCS._vcs_duplicate_repo(self, directory, revision)
+            vcs.VCS._vcs_duplicate_repo(self, directory, revision)
         else:
             status,output,error = \
                 self._u_invoke_client("get", revision,directory)
index bc47208210a88f7b0d65a64d9a4cb8033a4eba71..490ed6243044ceb65e766dae31abae4a499619aa 100644 (file)
@@ -13,6 +13,7 @@
 # You should have received a copy of the GNU General Public License along
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
 """
 Backwards compatibility support for Python 2.4.  Once people give up
 on 2.4 ;), the uuid call should be merged into bugdir.py
@@ -20,6 +21,7 @@ on 2.4 ;), the uuid call should be merged into bugdir.py
 
 import unittest
 
+
 try:
     from uuid import uuid4 # Python >= 2.5
     def uuid_gen():
index 6551fcf33dbc0679fa07680e9b3065209d68cadf..fd30ff74a74e67c38285273f366755ef0e3f1f14 100644 (file)
 # You should have received a copy of the GNU General Public License along
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+Define the Bug class for representing bugs.
+"""
+
 import os
 import os.path
 import errno
index af4391739c3c6a58e7c299f880fe5a542361e056..c4f0f9192b327035f90c8a88689f60a6044d6ccb 100644 (file)
 # You should have received a copy of the GNU General Public License along
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+Define the BugDir class for representing bug comments.
+"""
+
 import copy
 import errno
 import os
@@ -38,6 +43,7 @@ import settings_object
 import upgrade
 import utility
 
+
 class NoBugDir(Exception):
     def __init__(self, path):
         msg = "The directory \"%s\" has no bug directory." % path
index 48bfd64b18343010e0e339d3eec05ef423b984ed..c551ff00f4bdd8cab0cda9fa5f309e8e7506e517 100644 (file)
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+"""
+Bazaar (bzr) backend.
+"""
+
 import os
 import re
 import sys
@@ -24,12 +28,12 @@ import unittest
 import doctest
 
 import vcs
-from vcs import VCS
+
 
 def new():
     return Bzr()
 
-class Bzr(VCS):
+class Bzr(vcs.VCS):
     name = "bzr"
     client = "bzr"
     versioned = True
@@ -60,14 +64,14 @@ class Bzr(VCS):
         pass
     def _vcs_get_file_contents(self, path, revision=None, binary=False):
         if revision == None:
-            return VCS._vcs_get_file_contents(self, path, revision, binary=binary)
+            return vcs.VCS._vcs_get_file_contents(self, path, revision, binary=binary)
         else:
             status,output,error = \
                 self._u_invoke_client("cat","-r",revision,path)
             return output
     def _vcs_duplicate_repo(self, directory, revision=None):
         if revision == None:
-            VCS._vcs_duplicate_repo(self, directory, revision)
+            vcs.VCS._vcs_duplicate_repo(self, directory, revision)
         else:
             self._u_invoke_client("branch", "--revision", revision,
                                   ".", directory)
index 94a6856b953c677d06de37b84f0772f79f47ad2f..8c1c6128fce1c3f2a874bc186e168d0982bc3423 100644 (file)
 # You should have received a copy of the GNU General Public License along
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+Define assorted utilities to make command-line handling easier.
+"""
+
 import glob
 import optparse
 import os
index 5cb112970f6cf5c8df69f5cbaff6e9304b20b610..19c556ffbb012eb2e9b622b2e4307e635cdba23a 100644 (file)
 # You should have received a copy of the GNU General Public License along
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+Define the Comment class for representing bug comments.
+"""
+
 import base64
 import os
 import os.path
index 5e343b939ca2d94f9bf4c7d01f7f94e498875d1d..fb5a0288fbd0b8a3faf491197e6e2000fd4ae662 100644 (file)
 # You should have received a copy of the GNU General Public License along
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+Create, save, and load the per-user config file at path().
+"""
+
 import ConfigParser
 import codecs
 import locale
@@ -21,6 +26,7 @@ import os.path
 import sys
 import doctest
 
+
 default_encoding = sys.getfilesystemencoding() or locale.getpreferredencoding()
 
 def path():
index 3bbbed9b96f949fa5825a1a0c26b76d8627c279e..16005f2a71e065f2fbb8155920bf0fabea6632a9 100644 (file)
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+"""
+Darcs backend.
+"""
+
 import codecs
 import os
 import re
@@ -27,12 +31,12 @@ import doctest
 import unittest
 
 import vcs
-from vcs import VCS
+
 
 def new():
     return Darcs()
 
-class Darcs(VCS):
+class Darcs(vcs.VCS):
     name="darcs"
     client="darcs"
     versioned=True
@@ -90,7 +94,7 @@ class Darcs(VCS):
         pass # darcs notices changes
     def _vcs_get_file_contents(self, path, revision=None, binary=False):
         if revision == None:
-            return VCS._vcs_get_file_contents(self, path, revision,
+            return vcs.VCS._vcs_get_file_contents(self, path, revision,
                                               binary=binary)
         else:
             try:
@@ -118,7 +122,7 @@ class Darcs(VCS):
                 status,output,error = self._u_invoke(args, stdin=target_patch)
 
                 if os.path.exists(os.path.join(self.rootdir, path)) == True:
-                    contents = VCS._vcs_get_file_contents(self, path,
+                    contents = vcs.VCS._vcs_get_file_contents(self, path,
                                                           binary=binary)
                 else:
                     contents = ""
@@ -128,12 +132,12 @@ class Darcs(VCS):
                 status,output,error = self._u_invoke(args, stdin=target_patch)
                 args=["patch", path]
                 status,output,error = self._u_invoke(args, stdin=major_patch)
-                current_contents = VCS._vcs_get_file_contents(self, path,
+                current_contents = vcs.VCS._vcs_get_file_contents(self, path,
                                                               binary=binary)
                 return contents
     def _vcs_duplicate_repo(self, directory, revision=None):
         if revision==None:
-            VCS._vcs_duplicate_repo(self, directory, revision)
+            vcs.VCS._vcs_duplicate_repo(self, directory, revision)
         else:
             self._u_invoke_client("put", "--to-patch", revision, directory)
     def _vcs_commit(self, commitfile, allow_empty=False):
index 6c5828d2eb8a4409181631ade27ca9bc008efcd0..9253a23a99e819fd3030ac6f30bf09f21bba9f81 100644 (file)
 # You should have received a copy of the GNU General Public License along
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-"""Compare two bug trees"""
-from libbe import bugdir, bug, settings_object, tree
-from libbe.utility import time_to_str
+
+"""Compare two bug trees."""
+
 import difflib
 import doctest
 
+from libbe import bugdir, bug, settings_object, tree
+from libbe.utility import time_to_str
+
+
 class DiffTree (tree.Tree):
     """
     A tree holding difference data for easy report generation.
index 8f2bdbfcce782a37449720b59addb85fc10ec3af..ec410061fd79b384e4b83165c538966cf88b49dd 100644 (file)
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+"""
+Define editor_string(), a function that invokes an editor to accept
+user-produced text as a string.
+"""
+
 import codecs
 import locale
 import os
@@ -22,6 +27,7 @@ import sys
 import tempfile
 import doctest
 
+
 default_encoding = sys.getfilesystemencoding() or locale.getpreferredencoding()
 
 comment_marker = u"== Anything below this line will be ignored\n"
index 4af864ecea39c0b2c340cd23ad9c5fc40f78fa6d..fd513b56331aac3f898153c57da9c1396caddcca 100644 (file)
 # You should have received a copy of the GNU General Public License along
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+Support input/output/filesystem encodings (e.g. UTF-8).
+"""
+
 import codecs
 import locale
 import sys
 import doctest
 
+
 ENCODING = None # override get_encoding() output by setting this
 
 def get_encoding():
index 3345b577b1d8041247e48b6e04c4d63eab09080e..137cb35faecf8ed5bd3d9f9be650aa46ef661527 100644 (file)
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+"""
+Git backend.
+"""
+
 import os
 import re
 import sys
@@ -23,12 +27,12 @@ import unittest
 import doctest
 
 import vcs
-from vcs import VCS
+
 
 def new():
     return Git()
 
-class Git(VCS):
+class Git(vcs.VCS):
     name="git"
     client="git"
     versioned=True
@@ -89,14 +93,14 @@ class Git(VCS):
         self._vcs_add(path)
     def _vcs_get_file_contents(self, path, revision=None, binary=False):
         if revision == None:
-            return VCS._vcs_get_file_contents(self, path, revision, binary=binary)
+            return vcs.VCS._vcs_get_file_contents(self, path, revision, binary=binary)
         else:
             arg = "%s:%s" % (revision,path)
             status,output,error = self._u_invoke_client("show", arg)
             return output
     def _vcs_duplicate_repo(self, directory, revision=None):
         if revision==None:
-            VCS._vcs_duplicate_repo(self, directory, revision)
+            vcs.VCS._vcs_duplicate_repo(self, directory, revision)
         else:
             #self._u_invoke_client("archive", revision, directory) # makes tarball
             self._u_invoke_client("clone", "--no-checkout",".",directory)
index c7c736e34a1b19596ae9e4414ae7a54e1fcee7ce..f8f8121dd9f63669e7bbfb7a592427ecc6c1105a 100644 (file)
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+"""
+Mercurial (hg) backend.
+"""
+
 import os
 import re
 import sys
@@ -23,12 +27,12 @@ import unittest
 import doctest
 
 import vcs
-from vcs import VCS
+
 
 def new():
     return Hg()
 
-class Hg(VCS):
+class Hg(vcs.VCS):
     name="hg"
     client="hg"
     versioned=True
@@ -63,14 +67,14 @@ class Hg(VCS):
         pass
     def _vcs_get_file_contents(self, path, revision=None, binary=False):
         if revision == None:
-            return VCS._vcs_get_file_contents(self, path, revision, binary=binary)
+            return vcs.VCS._vcs_get_file_contents(self, path, revision, binary=binary)
         else:
             status,output,error = \
                 self._u_invoke_client("cat","-r",revision,path)
             return output
     def _vcs_duplicate_repo(self, directory, revision=None):
         if revision == None:
-            return VCS._vcs_duplicate_repo(self, directory, revision)
+            return vcs.VCS._vcs_duplicate_repo(self, directory, revision)
         else:
             self._u_invoke_client("archive", "--rev", revision, directory)
     def _vcs_commit(self, commitfile, allow_empty=False):
index 60def4dc08698d04bdaefa2d986cc9110a5f65a6..4d696013a6c6a0fb591caa440c63233207a51f43 100644 (file)
 # You should have received a copy of the GNU General Public License along
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-import yaml
-import os.path
+
+"""
+Provide a means of saving and loading dictionaries of parameters.  The
+saved "mapfiles" should be clear, flat-text files, and allow easy merging of
+independent/conflicting changes.
+"""
+
 import errno
-import utility
+import os.path
+import yaml
 import doctest
 
+
 class IllegalKey(Exception):
     def __init__(self, key):
         Exception.__init__(self, 'Illegal key "%s"' % key)
index 0545fd796f12f3d79c9f981d562095b82640fa62..d593d69132b115e205b99da55ff5ed72a6f03b02 100644 (file)
 # You should have received a copy of the GNU General Public License along
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+Allow simple listing and loading of the various becommands and libbe
+submodules (i.e. "plugins").
+"""
+
 import os
 import os.path
 import sys
index 45ae0855b47cd7a4ff50034f8a4ab79a156ad24a..06d09e55f7a6073ae84292c7c141ca1553941fcc 100644 (file)
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+"""
+Define a traversable tree structure.
+"""
+
 import doctest
 
 class Tree(list):
index 3df06b40b7373c26e62bef2bce932f41c3631723..aafbf8d164c5d77b446114d28347299c450c9b38 100644 (file)
 # You should have received a copy of the GNU General Public License along
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+Assorted utility functions that don't fit in anywhere else.
+"""
+
 import calendar
 import codecs
 import os
index e2916e63b5972a7c3322f577a641e7086d46cc01..3ee1a4426f9f4299158fbf34bf0afb5292ba9081 100644 (file)
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+"""
+Define the base VCS (Version Control System) class, which should be
+subclassed by other Version Control System backends.  The base class
+implements a "do not version" VCS.
+"""
+
 from subprocess import Popen, PIPE
 import codecs
 import os