[PATCH 1/2] Fix various syntax errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Courtesey of pylint, this patch also fixes some things which are not
syntax errors but still make pylint unhappy.
---
 __init__.py             |   11 ++++++++---
 gui.py                  |    1 +
 iw/filter_gui.py        |    2 +-
 storage/__init__.py     |    2 +-
 storage/devices.py      |    9 +++++----
 storage/partitioning.py |    4 ++--
 6 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/__init__.py b/__init__.py
index 97383db..0d63e7b 100644
--- a/__init__.py
+++ b/__init__.py
@@ -28,7 +28,7 @@
 #            Matt Wilson <msw@xxxxxxxxx>
 #
 
-import os, time
+import os, time, string
 from tempfile import mkstemp
 
 import logging
@@ -105,6 +105,7 @@ class Anaconda(object):
     @property
     def firstboot(self):
         from pykickstart.constants import FIRSTBOOT_SKIP, FIRSTBOOT_DEFAULT
+        import iutil
 
         if self.ksdata:
             return self.ksdata.firstboot.firstboot
@@ -220,6 +221,8 @@ class Anaconda(object):
             try:
                 from gui import InstallInterface
             except Exception, e:
+                import isys
+                from flags import flags
                 stdoutLog.error("Exception starting GUI installer: %s" %(e,))
                 # if we're not going to really go into GUI mode, we need to get
                 # back to vc1 where the text install is going to pop up.
@@ -271,6 +274,7 @@ class Anaconda(object):
             self.methodstr = methodstr
 
     def requiresNetworkInstall(self):
+        import isys
         fail = False
         numNetDevs = isys.getNetworkDeviceCount()
 
@@ -303,6 +307,7 @@ class Anaconda(object):
         self.firewall.write(self.rootPath)
 
         if self.ksdata:
+            import iutil
             for svc in self.ksdata.services.disabled:
                 iutil.execWithRedirect("/sbin/chkconfig",
                                        [svc, "off"],
@@ -325,9 +330,9 @@ class Anaconda(object):
         f.write("#version=%s\n" % versionToString(DEVEL))
 
         if self.upgrade:
-            f.write("upgrade\n");
+            f.write("upgrade\n")
         else:
-            f.write("install\n");
+            f.write("install\n")
 
         m = None
 
diff --git a/gui.py b/gui.py
index c11f971..ddc6793 100755
--- a/gui.py
+++ b/gui.py
@@ -1373,6 +1373,7 @@ class InstallControlWindow:
         self.currentWindow = None
         self.anaconda = anaconda
         self.handle = None
+        self.window = None
 
     def keyRelease (self, window, event):
         if ((event.keyval == gtk.keysyms.KP_Delete
diff --git a/iw/filter_gui.py b/iw/filter_gui.py
index 6941f8f..4fc4333 100644
--- a/iw/filter_gui.py
+++ b/iw/filter_gui.py
@@ -144,7 +144,7 @@ class Callbacks(object):
         global selectedDevices, totalDevices
         global selectedSize, totalSize
 
-        self.sizeLabel.set_markup(_("Selected devices: %s (%s MB) out of %s (%s MB)." % (selectedDevices, selectedSize, totalDevices, totalSize))
+        self.sizeLabel.set_markup(_("Selected devices: %s (%s MB) out of %s (%s MB).") % (selectedDevices, selectedSize, totalDevices, totalSize))
 
     def visible(self, model, iter, view):
         # Most basic visibility function - does the model say this row
diff --git a/storage/__init__.py b/storage/__init__.py
index b19dd18..1cc7608 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -108,7 +108,7 @@ def storageInitialize(anaconda):
                 anaconda.intf.messageWindow(_("Unknown Device"),
                     _("The installation source given by device %s "
                       "could not be found.  Please check your "
-                      "parameters and try again.") % devspec,
+                      "parameters and try again.") % anaconda.protected,
                     type="custom", custom_buttons = [_("_Exit installer")])
                 sys.exit(1)
     else:
diff --git a/storage/devices.py b/storage/devices.py
index 5413066..84cf4c1 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2421,10 +2421,11 @@ class MDRaidArrayDevice(StorageDevice):
         # For new arrays check if we have enough members
         if (not exists and parents and
                 len(parents) < mdraid.get_raid_min_members(self.level)):
-            raise ValueError, P_("A RAID%d set requires at least %d member",
-                                 "A RAID%d set requires at least %d members",
-                                 mdraid.get_raid_min_members(self.level)) %
-                                 self.level, mdraid.get_raid_min_members(self.level)
+            raise ValueError, P_("A RAID%d set requires at least %d member" %
+                                 (self.level, mdraid.get_raid_min_members(self.level)),
+                                 "A RAID%d set requires at least %d members" %
+                                 (self.level, mdraid.get_raid_min_members(self.level)),
+                                 mdraid.get_raid_min_members(self.level))
 
         self.uuid = uuid
         self._totalDevices = numeric_type(totalDevices)
diff --git a/storage/partitioning.py b/storage/partitioning.py
index 719e21f..7cc478e 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -1128,8 +1128,8 @@ class Request(object):
 
     def __str__(self):
         s = ("%(type)s instance --\n"
-             "id = %(id)s  name = %(name)s  growable = %(growable)\n"
-             "base = %(base)d  growth = %(grow)d  max_grow = %(max_grow)d\n"
+             "id = %(id)s  name = %(name)s  growable = %(growable)s\n"
+             "base = %(base)d  growth = %(growth)d  max_grow = %(max_grow)d\n"
              "done = %(done)s" %
              {"type": self.__class__.__name__, "id": self.id,
               "name": self.partition.name, "growable": self.growable,
-- 
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux