[yum-commits] 7 commits - cli.py output.py shell.py test/yum-pylintrc yumcommands.py yum/depsolve.py yum/history.py yum/__init__.py yummain.py yum/packageSack.py yum/rpmsack.py

Tim Lauridsen timlau at osuosl.org
Tue Nov 29 15:12:47 UTC 2011


 cli.py             |    2 ++
 output.py          |    4 ++--
 shell.py           |    2 +-
 test/yum-pylintrc  |    2 +-
 yum/__init__.py    |    3 ++-
 yum/depsolve.py    |    1 -
 yum/history.py     |    3 +++
 yum/packageSack.py |    1 +
 yum/rpmsack.py     |    2 +-
 yumcommands.py     |    2 +-
 yummain.py         |    2 +-
 11 files changed, 15 insertions(+), 9 deletions(-)

New commits:
commit a34015ef0e1940b72b4c165ed970cffea9549450
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date:   Tue Nov 29 14:00:42 2011 +0100

    Fix pylint issues (unused imports)
    
    ************* Module cli
    W0611: 51: Unused import parsePackages
    ************* Module shell
    W0611: 26: Unused import _
    ************* Module yummain
    W0611: 32: Unused import to_unicode
    ************* Module yum.depsolve
    W0611: 35: Unused import packages

diff --git a/cli.py b/cli.py
index bbe8e55..7bd341d 100755
--- a/cli.py
+++ b/cli.py
@@ -48,7 +48,9 @@ from yum.i18n import to_unicode, to_utf8, exception2msg
 #  This is for yum-utils/yumdownloader in RHEL-5, where it isn't importing this
 # directly but did do "from cli import *", and we did have this in 3.2.22. I
 # just _love_ how python re-exports these by default.
+# pylint: disable-msg=W0611
 from yum.packages import parsePackages
+# pylint: enable-msg=W0611
 
 def sigquit(signum, frame):
     """SIGQUIT handler for the yum cli.  This function will print an
diff --git a/shell.py b/shell.py
index 34a492e..2232b03 100644
--- a/shell.py
+++ b/shell.py
@@ -23,7 +23,7 @@ import cmd
 import shlex
 import logging
 
-from yum import Errors, _
+from yum import Errors
 from yum.constants import *
 import yum.logginglevels as logginglevels
 from yum.i18n import to_utf8
diff --git a/yum/depsolve.py b/yum/depsolve.py
index c518311..720188c 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -32,7 +32,6 @@ import rpm
 
 from packageSack import ListPackageSack
 from constants import *
-import packages
 import logginglevels
 import Errors
 import warnings
diff --git a/yummain.py b/yummain.py
index 58179d2..12582d2 100755
--- a/yummain.py
+++ b/yummain.py
@@ -29,7 +29,7 @@ from yum import Errors
 from yum import plugins
 from yum import logginglevels
 from yum import _
-from yum.i18n import to_unicode, utf8_width, exception2msg
+from yum.i18n import utf8_width, exception2msg
 import yum.misc
 import cli
 from utils import suppress_keyboard_interrupt_message, show_lock_owner
commit b1f4aadd0a1e4197ea432d30def7539db74c5367
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date:   Tue Nov 29 13:50:25 2011 +0100

    remove string as deprecated module from pylint conf

diff --git a/test/yum-pylintrc b/test/yum-pylintrc
index 67cf1ea..ea4e683 100644
--- a/test/yum-pylintrc
+++ b/test/yum-pylintrc
@@ -219,7 +219,7 @@ defining-attr-methods=__init__,__new__,setUp
 [IMPORTS]
 
 # Deprecated modules which should not be used, separated by a comma
-deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
+deprecated-modules=regsub,TERMIOS,Bastion,rexec
 
 # Create a graph of every (i.e. internal and external) dependencies in the
 # given file (report RP0402 must not be disabled)
commit fe5a4d490d65b9e15f1fdd80803439fc3987a47f
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date:   Tue Nov 29 13:45:18 2011 +0100

    remove pylint false positives
    
    ************* Module yum.history
    E0203:1484:YumHistory._update_db_file_3: Access to member '_cached_updated_3' before its definition line 1499
    E0203:1571:YumHistory._update_db_file_2: Access to member '_cached_updated_2' before its definition line 1586

diff --git a/yum/history.py b/yum/history.py
index d27fa44..1168601 100644
--- a/yum/history.py
+++ b/yum/history.py
@@ -1475,6 +1475,7 @@ class YumHistory:
  CREATE INDEX i_pkgkey_yumdb ON pkg_yumdb (pkgtupid, yumdb_key);
 ''']
 
+# pylint: disable-msg=E0203
     def _update_db_file_3(self):
         """ Update to version 3 of history, rpmdb/yumdb data. """
         if not self._update_db_file_2():
@@ -1586,6 +1587,8 @@ class YumHistory:
         self._cached_updated_2 = True
         return True
 
+# pylint: enable-msg=E0203
+
     def _create_db_file(self):
         """ Create a new history DB file, populating tables etc. """
 
commit cfb8967cfd6f729e1e023b2ddac43cbe92a99988
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date:   Tue Nov 29 13:37:15 2011 +0100

    fix pylint issue
    
    ************* Module yum.packageSack
    E0601:462:MetaSack.returnObsoletes: Using variable 'last_pkgtup' before assignment

diff --git a/yum/packageSack.py b/yum/packageSack.py
index 62608eb..47832fc 100644
--- a/yum/packageSack.py
+++ b/yum/packageSack.py
@@ -445,6 +445,7 @@ class MetaSack(PackageSackBase):
         nobsdict = {}
         last_name = ''
         last_pkg = None
+        last_pkgtup = None
         #  It takes about 0.2 of a second to convert these into packages, just
         # so we can sort them, which is ~40% of this functions time. So we sort
         # the pkgtups "by hand".
commit 8341f6fab9d5a1467fee909a9987aa0d917b3b3c
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date:   Tue Nov 29 13:16:26 2011 +0100

    Fix pylint issue:
    
    ************* Module yum
    E0601:5832:YumBase.load_ts: Using variable 'missingany' before assignment

diff --git a/yum/__init__.py b/yum/__init__.py
index 797838a..eccc6b7 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -5823,6 +5823,7 @@ class YumBase(depsolve.Depsolve):
         pkgcount = 0
         pkgprob = False
         curpkg = None
+        missingany = False
         for l in data[pkgstart:]:
             l = l.rstrip()
             # our main txmbrs
commit 7498c0878a3f804c55236a1c2af8463dee4ead4a
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date:   Tue Nov 29 13:11:43 2011 +0100

    Fix pylint issue:
    
    ************* Module yum
    E9905:4858:YumBase._ui_nevra_dict: Too many arguments for format string

diff --git a/yum/__init__.py b/yum/__init__.py
index b07bbb2..797838a 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -4855,7 +4855,7 @@ class YumBase(depsolve.Depsolve):
         if e and v and r:
             evr = '%s:%s-%s' % (e, v, r)
         elif v and r:
-            evr = '%s-%s' % (e, v, r)
+            evr = '%s-%s' % (v, r)
         elif e and v:
             evr = '%s:%s' % (e, v)
         elif v: # e and r etc. is just too weird to print
commit de06cb48271f981fb83aab91b8124bab82c185c4
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date:   Tue Nov 29 12:56:57 2011 +0100

    fix pylint issues (Bad indentation)
    ************* Module output
    W0311:2186: Bad indentation. Found 20 spaces, expected 16
    ************* Module yumcommands
    W0311:901: Bad indentation. Found 11 spaces, expected 12
    ************* Module yum.rpmsack
    W0311:1008: Bad indentation. Found 13 spaces, expected 12

diff --git a/output.py b/output.py
index be4e4d9..bc115ca 100755
--- a/output.py
+++ b/output.py
@@ -2183,8 +2183,8 @@ to exit.
             default_addons = set(['config-main', 'config-repos', 'saved_tx'])
             non_default = set(addon_info).difference(default_addons)
             if len(non_default) > 0:
-                    print _("Additional non-default information stored: %d" 
-                                % len(non_default))
+                print _("Additional non-default information stored: %d" 
+                            % len(non_default))
 
         if old.trans_with:
             # This is _possible_, but not common
diff --git a/yum/rpmsack.py b/yum/rpmsack.py
index 635f03f..424b821 100644
--- a/yum/rpmsack.py
+++ b/yum/rpmsack.py
@@ -1005,7 +1005,7 @@ class RPMDBPackageSack(PackageSackBase):
             return
 
         if not load_packages:
-             return checksum_data
+            return checksum_data
 
         for pkgtup in checksum_data:
             if checksum_data[pkgtup] is None:
diff --git a/yumcommands.py b/yumcommands.py
index 172c40d..2ff9562 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -898,7 +898,7 @@ class GroupsCommand(YumCommand):
         cmd, extcmds = self._grp_cmd(basecmd, extcmds)
 
         if cmd in ('remove',):
-           return True
+            return True
         return False
 
 class MakeCacheCommand(YumCommand):


More information about the Yum-commits mailing list