ArchiveOrangemail archive

Discussion of Development and Customization of the Red Hat Linux Installer


anaconda-devel-list.redhat.com
(List home) (Recent threads) (164 other Red Hat lists)

Subscription Options

  • RSS or Atom: Read-only subscription using a browser or aggregator. This is the recommended way if you don't need to send messages to the list. You can learn more about feed syndication and clients here.
  • Conventional: All messages are delivered to your mail address, and you can reply. To subscribe, send an email to the list's subscribe address with "subscribe" in the subject line, or visit the list's homepage here.
  • Low traffic list: less than 3 messages per day
  • This list contains about 25,934 messages, beginning Dec 2001
  • 5 messages added yesterday
Report the Spam
This button sends a spam report to the moderator. Please use it sparingly. For other removal requests, read this.
Are you sure? yes no

Disable E1103 (the "some types could not be inferred" message).

Ad
Chris Lumens 1311961485Fri, 29 Jul 2011 17:44:45 +0000 (UTC)
We hit this for every use of a pyanaconda.product value, so it's really just
noise.
---
 tests/pylint/pylint-false-positives |    6 ------
 tests/pylint/runpylint.sh           |    1 +
 2 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/tests/pylint/pylint-false-positives b/tests/pylint/pylint-false-positives
index bde04b5..97f566c 100644
--- a/tests/pylint/pylint-false-positives
+++ b/tests/pylint/pylint-false-positives
@@ -26,12 +26,6 @@
 ^E1101:[ 0-9]*:.*: Instance of 'dict' has no 'Get' member$
 ^E1101:[ 0-9]*:FilteredCallbacks\..*set: Instance of 'FilteredCallbacks' has no 'notebook' member$
 ^E1101:[ 0-9]*:Anaconda\.backend: Instance of 'DefaultInstall' has no 'getBackend' member$
-^E1103:[ 0-9]*:.*: Instance of 'str' has no '.*' member \(but some types could not be inferred\)$
-^E1103:[ 0-9]*:execWithCapture: Instance of 'list' has no 'splitlines' member \(but some types could not be inferred\)$
-^E1103:[ 0-9]*:VncServer\.connectToView: Instance of 'list' has no 'startswith' member \(but some types could not be inferred\)$
-^E1103:[ 0-9]*:VncServer\.connectToView: Instance of 'list' has no 'endswith' member \(but some types could not be inferred\)$
-^E1103:[ 0-9]*:bindMountDevDirectory: Instance of 'DeviceFormat' has no 'mount' member \(but some types could not be inferred\)$
-^E1103:[ 0-9]*:DeviceTree.handleUdevDiskLabelFormat: Instance of 'DeviceFormat' has no 'partitions' member \(but some types could not be inferred\)$
 ^W0404:[ 0-9]*:runRescue: Reimport 'runPostScripts' \(imported line [0-9]*\)$
 # Note this will become a real issue when we start supporting multiple netdevs
 ^W0631:[ 0-9]*:Network.write: Using possibly undefined loop variable 'dev'$
diff --git a/tests/pylint/runpylint.sh b/tests/pylint/runpylint.sh
index cdd5fc4..721a122 100755
--- a/tests/pylint/runpylint.sh
+++ b/tests/pylint/runpylint.sh
@@ -54,6 +54,7 @@ for i in pyanaconda/storage pyanaconda/installclasses/*.py pyanaconda/iw/*.py py
     --disable=W0511,W0403,W0703,W0622,W0614,W0401,W0142,W0613,W0621,W0141 \
     --disable=W0102,W0201,W0221,W0702,W0602,W0603,W0604,W1001,W0223 \
     --disable=W0231,W0232,W0233,W0404 \
+    --disable=E1103 \
     $NON_STRICT_OPTIONS $i | \
     egrep -v "`cat $FALSE_POSITIVES | tr '\n' '|'`" > pylint-tmp-log
   if grep -q -v '************* Module ' pylint-tmp-log; then-- 
1.7.6
Chris Lumens 1311961485Fri, 29 Jul 2011 17:44:45 +0000 (UTC)
---
 pyanaconda/storage/devices.py |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index 0ac9aa4..d3c3bda 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -262,14 +262,7 @@ class Device(object):
         return s     def __str__(self):
-        exist = "existing"
-        if not self.exists:
-            exist = "non-existent"
-        s = "%s %dMB %s %s (%d)" % (exist, self.size, self.type, self.name,
-                                    self.id)
-        if self.format.type:
-            s += " with %s" % self.format
-
+        s = "%s %s (%d)" % (self.type, self.name, self.id)
         return s     @property
@@ -489,6 +482,16 @@ class StorageDevice(Device):         self._partedDevice = None+    def __str__(self):
+        exist = "existing"
+        if not self.exists:
+            exist = "non-existent"
+        s = "%s %dMB %s" % (exist, self.size, super(StorageDevice, self).__str__())
+        if self.format.type:
+            s += " with %s" % self.format
+
+        return s
+
     @property
     def packages(self):
         """ List of packages required to manage devices of this type.-- 
1.7.6
Chris Lumens 1311961490Fri, 29 Jul 2011 17:44:50 +0000 (UTC)
This is the first step in seeing which we really need to ignore, and which
we were just ignoring out of convenience.
---
 tests/pylint/runpylint.sh |   48 ++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 43 insertions(+), 5 deletions(-)

diff --git a/tests/pylint/runpylint.sh b/tests/pylint/runpylint.sh
index 721a122..8c3e74b 100755
--- a/tests/pylint/runpylint.sh
+++ b/tests/pylint/runpylint.sh
@@ -9,7 +9,47 @@
 # warnings are found it exits with a status of 0 FALSE_POSITIVES=tests/pylint/pylint-false-positives
-NON_STRICT_OPTIONS="--disable=W0612,W0212,W0312,W0611,W0402,W0108,W0107,W0311,W0710"
+
+# W0107 - Unnecessary pass statement
+# W0108 - Lambda may not be necessary
+# W0212 - Access to a protected member %s of a client class
+# W0311 - Bad indentation. Found %s %s, expected %s
+# W0312 - Found indentation with %ss instead of %ss
+# W0402 - Uses of a deprecated module %r
+# W0611 - Unused import %s
+# W0612 - Unused variable %r
+# W0710 - Exception doesn't inherit from standard "Exception" class
+NON_STRICT_OPTIONS="--disable=W0107,W0108,W0212,W0311,W0312,W0402,W0611,W0612,W0710"
+
+# E1103 - %s %r has no %r member (but some types could not be inferred)
+DISABLED_ERR_OPTIONS="--disable=E1103"
+
+# W0102 - Dangerous default value %s as argument
+# W0141 - Used builtin function %r
+# W0142 - Used * or ** magic
+# W0201 - Attribute %r defined outside __init__
+# W0221 - Arguments number differs from %s method
+# W0223 - Method %r is abstract in class %r but is not overridden
+# W0231 - __init__ method from base class %r is not called
+# W0232 - Class has no __init__ method
+# W0233 - __init__ method from a non direct base class %r is called
+# W0401 - Wildcard import %s
+# W0403 - Relative import %r, should be %r
+# W0404 - Reimport %r (imported line %s)
+# W0511 - Used when a warning note as FIXME or XXX is detected.
+# W0602 - Using global for %r but no assignment is done
+# W0603 - Using the global statement
+# W0604 - Using the global statement at the module level
+# W0613 - Unused argument %r
+# W0614 - Unused import %s from wildcard import
+# W0621 - Redefining name %r from outer scope (line %s)
+# W0622 - Redefining built-in %r
+# W0702 - No exception type(s) specified
+# W0703 - Catch "Exception"
+# W1001 - Use of "property" on an old style class
+DISABLED_WARN_OPTIONS="--disable=W0102,W0141,W0142,W0201,W0221,W0223,W0231,W0232 \
+                       --disable=W0233,W0401,W0403,W0404,W0511,W0602,W0603,W0604 \
+                       --disable=W0613,W0614,W0621,W0622,W0702,W0703,W1001" usage () {
   echo "usage: `basename $0` [--strict] [--help]"
@@ -51,10 +91,8 @@ for i in pyanaconda/storage pyanaconda/installclasses/*.py pyanaconda/iw/*.py py
       sys.path.insert(7, "/usr/share/system-config-date"); \
       sys.path.insert(8, "/usr/share/system-config-keyboard")' \
     -i y -r n --disable=C,R --rcfile=/dev/null \
-    --disable=W0511,W0403,W0703,W0622,W0614,W0401,W0142,W0613,W0621,W0141 \
-    --disable=W0102,W0201,W0221,W0702,W0602,W0603,W0604,W1001,W0223 \
-    --disable=W0231,W0232,W0233,W0404 \
-    --disable=E1103 \
+    $DISABLED_WARN_OPTIONS \
+    $DISABLED_ERR_OPTIONS \
     $NON_STRICT_OPTIONS $i | \
     egrep -v "`cat $FALSE_POSITIVES | tr '\n' '|'`" > pylint-tmp-log
   if grep -q -v '************* Module ' pylint-tmp-log; then-- 
1.7.6
Chris Lumens 1311961493Fri, 29 Jul 2011 17:44:53 +0000 (UTC)
The sitecustomize error is because sys.setdefaultencoding is special and
gets removed from the namespace.

The other two are because pylint doesn't understand the dbMatch method call,
likely because it's added to the module dynamically.
---
 pyanaconda/security.py         |    1 +
 pyanaconda/sitecustomize.py    |    1 +
 pyanaconda/storage/__init__.py |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/security.py b/pyanaconda/security.py
index 5c71012..6f9449b 100644
--- a/pyanaconda/security.py
+++ b/pyanaconda/security.py
@@ -64,6 +64,7 @@ class Security:         iutil.resetRpmDb(rootPath)
         ts = rpm.TransactionSet(rootPath)
+        # pylint: disable-msg=E1101
         return ts.dbMatch('provides', 'fprintd-pam').count()     def write(self, instPath):
diff --git a/pyanaconda/sitecustomize.py b/pyanaconda/sitecustomize.py
index 8246ed0..f2bcd10 100644
--- a/pyanaconda/sitecustomize.py
+++ b/pyanaconda/sitecustomize.py
@@ -19,4 +19,5 @@
 # import sys
+# pylint: disable-msg=E1101
 sys.setdefaultencoding('utf-8')
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index db4a67a..c39bc0d 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -1440,6 +1440,7 @@ def getReleaseString(mountpoint):     # We get the arch from the initscripts package, but the version and name
     # must come from reading the release file.
+    # pylint: disable-msg=E1101
     mi = ts.dbMatch('provides', 'initscripts')
     for h in mi:
         relArch = h['arch']-- 
1.7.6
Chris Lumens 1311961499Fri, 29 Jul 2011 17:44:59 +0000 (UTC)
It also gets rid of an "import *", which we all hate.---
 pyanaconda/storage/devicelibs/mpath.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/storage/devicelibs/mpath.py b/pyanaconda/storage/devicelibs/mpath.py
index e128961..ea466a5 100644
--- a/pyanaconda/storage/devicelibs/mpath.py
+++ b/pyanaconda/storage/devicelibs/mpath.py
@@ -1,7 +1,7 @@ import re-from ..udev import *
+from ..udev import udev_device_is_disk
 from pyanaconda import iutil
 from pyanaconda.anaconda_log import log_method_call-- 
1.7.6
Chris Lumens 1311961501Fri, 29 Jul 2011 17:45:01 +0000 (UTC)
pylint doesn't know how to deal with these.  See:

    http://www.logilab.org/ticket/51222
---
 pyanaconda/bootloader.py |   11 +++++++++++
 pyanaconda/dispatch.py   |    2 ++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index ab89d51..31a78c8 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -196,6 +196,7 @@ class BootLoader(object):
     #
     # stage1 device access
     #
+    # pylint: disable-msg=E0202
     @property
     def stage1_device(self):
         """ Stage1 target device. """
@@ -213,6 +214,7 @@ class BootLoader(object):         return self._stage1_device+    # pylint: disable-msg=E0102,E0202,E1101
     @stage1_device.setter
     def stage1_device(self, device):
         log.debug("new bootloader stage1 device: %s" % getattr(device,
@@ -221,6 +223,7 @@ class BootLoader(object):
         if device:
             self.stage1_drive = device.disks[0]+    # pylint: disable-msg=E0202
     @property
     def stage2_device(self):
         """ Stage2 target device. """
@@ -229,11 +232,13 @@ class BootLoader(object):
     #
     # drive list access
     #
+    # pylint: disable-msg=E0202
     @property
     def drive_order(self):
         """Potentially partial order for drives."""
         return self._drive_order+    # pylint: disable-msg=E0102,E0202,E1101
     @drive_order.setter
     def drive_order(self, order):
         log.debug("new drive order: %s" % order)
@@ -278,6 +283,7 @@ class BootLoader(object):
     #
     # image list access
     #
+    # pylint: disable-msg=E0202
     @property
     def default(self):
         """The default image."""
@@ -293,6 +299,7 @@ class BootLoader(object):         return self._default_image+    # pylint: disable-msg=E0102,E0202,E1101
     @default.setter
     def default(self, image):
         if image not in self.images:
@@ -709,6 +716,7 @@ class BootLoader(object):
     def has_windows(self):
         return False+    # pylint: disable-msg=E0202
     @property
     def timeout(self):
         """Bootloader timeout in seconds."""
@@ -721,14 +729,17 @@ class BootLoader(object):         return t+    # pylint: disable-msg=E0102,E0202,E1101
     @timeout.setter
     def timeout(self, seconds):
         self._timeout = seconds+    # pylint: disable-msg=E0202
     @property
     def update_only(self):
         return self._update_only+    # pylint: disable-msg=E0102,E0202,E1101
     @update_only.setter
     def update_only(self, value):
         if value and not self.can_update:
diff --git a/pyanaconda/dispatch.py b/pyanaconda/dispatch.py
index 820a92b..900950f 100644
--- a/pyanaconda/dispatch.py
+++ b/pyanaconda/dispatch.py
@@ -208,10 +208,12 @@ class Dispatcher(object):
             i -= 1
         return False+    #pylint: disable-msg=E0202
     @property
     def dir(self):
         return self.anaconda.dir+    # pylint: disable-msg=E0102,E0202,E1101
     @dir.setter
     def dir(self, dir):
         if dir not in [DISPATCH_BACK, DISPATCH_FORWARD, DISPATCH_DEFAULT]:-- 
1.7.6
Brian C. Lane 1311980708Fri, 29 Jul 2011 23:05:08 +0000 (UTC)
Ack these 6.

I don't really like having to use the in-line disables, but I can't
think of any alternative. It is better than blindly disabling them.
Home | About | Privacy