[yum-cvs] 6 commits - cli.py output.py shell.py yum/misc.py yumcommands.py

James Bowes jbowes at linux.duke.edu
Mon Nov 12 21:52:55 UTC 2007


 cli.py         |   11 ++++++++++-
 output.py      |   14 ++++++++++++++
 shell.py       |    9 +++++++++
 yum/misc.py    |   14 +++++++++++++-
 yumcommands.py |    9 +++++++++
 5 files changed, 55 insertions(+), 2 deletions(-)

New commits:
commit a22034ef6139344d367c6a895fcc17a4cf064fdf
Merge: 34e04ce... 22476b4...
Author: James Bowes <jbowes at redhat.com>
Date:   Mon Nov 12 16:52:12 2007 -0500

    Merge branch 'epydoc'

commit 22476b42277b77479028498c7d1cba5cd27f6985
Author: James Bowes <jbowes at redhat.com>
Date:   Sun Nov 11 19:02:51 2007 -0500

    Docstring additions for the shell module.

diff --git a/shell.py b/shell.py
index 27f52a7..b2aab23 100644
--- a/shell.py
+++ b/shell.py
@@ -13,6 +13,10 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 # Copyright 2005 Duke University
 
+"""
+A shell implementation for the yum command line interface.
+"""
+
 import sys
 import cmd
 import shlex
@@ -24,6 +28,11 @@ import yum.logginglevels as logginglevels
 
 
 class YumShell(cmd.Cmd):
+
+    """
+    Interactive yum shell.
+    """
+
     def __init__(self, base):
         cmd.Cmd.__init__(self)
         self.base = base
commit b10d5a65fb1165c5418122542dd54858a003c66a
Author: James Bowes <jbowes at redhat.com>
Date:   Sun Nov 11 09:05:52 2007 -0500

    Docstring updates for the output module.

diff --git a/output.py b/output.py
index ea81af2..a18ab96 100644
--- a/output.py
+++ b/output.py
@@ -37,6 +37,11 @@ from yum import logginglevels
 from yum.rpmtrans import RPMBaseCallback
 
 class YumTextMeter(TextMeter):
+
+    """
+    Text progress bar output.
+    """
+
     def update(self, amount_read, now=None):
         checkSignals()
         TextMeter.update(self, amount_read, now)
@@ -204,6 +209,10 @@ class YumTerm:
 
 class YumOutput:
 
+    """
+    Main output class for the yum command line.
+    """
+
     def __init__(self):
         self.logger = logging.getLogger("yum.cli")
         self.verbose_logger = logging.getLogger("yum.verbose.cli")
@@ -642,6 +651,11 @@ class CacheProgressCallback:
         progressbar(current, total, name)
 
 class YumCliRPMCallBack(RPMBaseCallback):
+
+    """
+    Yum specific callback class for RPM operations.
+    """
+
     def __init__(self):
         RPMBaseCallback.__init__(self)
         self.lastmsg = None
commit dac1882982bb841909ab5db8a9d2da69a41ca2fb
Author: James Bowes <jbowes at redhat.com>
Date:   Sat Nov 10 14:13:08 2007 -0500

    More doc changes

diff --git a/yum/misc.py b/yum/misc.py
index 40bdf83..5f17758 100644
--- a/yum/misc.py
+++ b/yum/misc.py
@@ -1,3 +1,7 @@
+"""
+Assorted utility functions for yum.
+"""
+
 import types
 import os
 import os.path
@@ -299,7 +303,7 @@ def sortPkgObj(pkg1 ,pkg2):
         return -1
         
 def newestInList(pkgs):
-    # return the newest in the list of packages
+    """ Return the newest in the list of packages. """
     ret = [ pkgs.pop() ]
     newest = ret[0]
     for pkg in pkgs:
@@ -311,6 +315,13 @@ def newestInList(pkgs):
     return ret
 
 def version_tuple_to_string(evrTuple):
+    """
+    Convert a tuple representing a package version to a string.
+
+    @param evrTuple: A 3-tuple of epoch, version, and release.
+
+    Return the string representation of evrTuple.
+    """
     (e, v, r) = evrTuple
     s = ""
     
@@ -344,6 +355,7 @@ def refineSearchPattern(arg):
     return restring
     
 def bunzipFile(source,dest):
+    """ Extract the bzipped contents of source to dest. """
     s_fn = bz2.BZ2File(source, 'r')
     destination = open(dest, 'w')
 
diff --git a/yumcommands.py b/yumcommands.py
index 3c68550..fde5fb5 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -29,7 +29,7 @@ def checkRootUID(base):
     """
     Verify that the program is being run by the root user.
 
-    @base: a YumBase object.
+    @param base: a YumBase object.
     """
     if base.conf.uid != 0:
         base.logger.critical(_('You need to be root to perform this command.'))
commit 737a33b059e9f7831de178c45c6b50749f42c4e0
Author: James Bowes <jbowes at redhat.com>
Date:   Sat Nov 10 14:07:02 2007 -0500

    Add some docstrings for the yumcommands module.

diff --git a/yumcommands.py b/yumcommands.py
index 0f5ec94..3c68550 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -15,6 +15,10 @@
 # Copyright 2006 Duke University 
 # Written by Seth Vidal
 
+"""
+Classes for subcommands of the yum command line interface.
+"""
+
 import os
 import cli
 from yum import logginglevels
@@ -22,6 +26,11 @@ import yum.Errors
 from i18n import _
 
 def checkRootUID(base):
+    """
+    Verify that the program is being run by the root user.
+
+    @base: a YumBase object.
+    """
     if base.conf.uid != 0:
         base.logger.critical(_('You need to be root to perform this command.'))
         raise cli.CliError
commit a88b52a8842f320d7cde8e4531a019e35deece94
Author: James Bowes <jbowes at redhat.com>
Date:   Sat Nov 10 14:03:27 2007 -0500

    Add docstrings for the cli module.

diff --git a/cli.py b/cli.py
index f33abd9..a410119 100644
--- a/cli.py
+++ b/cli.py
@@ -15,6 +15,9 @@
 # Copyright 2005 Duke University 
 # Written by Seth Vidal
 
+"""
+Command line interface yum class and related.
+"""
 
 import os
 import re
@@ -42,11 +45,17 @@ import signal
 import yumcommands
 
 def sigquit(signum, frame):
+    """ SIGQUIT handler for the yum cli. """
     print >> sys.stderr, "Quit signal sent - exiting immediately"
     sys.exit(1)
 
 class CliError(yum.Errors.YumBaseError):
-   def __init__(self, args=''):
+
+    """
+    Command line interface related Exception.
+    """
+
+    def __init__(self, args=''):
         yum.Errors.YumBaseError.__init__(self)
         self.args = args
 



More information about the Yum-cvs-commits mailing list