diff options
author | Cole Robinson <crobinso@redhat.com> | 2014-03-22 11:21:19 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2014-03-22 11:21:19 -0400 |
commit | 8562c3258e83cef5fe8f24386be58e73c8eda813 (patch) | |
tree | f537870da28756ac826517bb985a20a2afd36b27 /virtManager | |
parent | d7631268628da1ae102414644add7979ded08bd7 (diff) | |
download | virt-manager-8562c3258e83cef5fe8f24386be58e73c8eda813.tar.gz |
More pylint fixes
Diffstat (limited to 'virtManager')
-rw-r--r-- | virtManager/asyncjob.py | 1 | ||||
-rw-r--r-- | virtManager/autodrawer.py | 3 | ||||
-rw-r--r-- | virtManager/baseclass.py | 3 | ||||
-rw-r--r-- | virtManager/connection.py | 6 | ||||
-rw-r--r-- | virtManager/console.py | 1 | ||||
-rw-r--r-- | virtManager/error.py | 1 | ||||
-rw-r--r-- | virtManager/graphwidgets.py | 3 | ||||
-rw-r--r-- | virtManager/systray.py | 10 |
8 files changed, 20 insertions, 8 deletions
diff --git a/virtManager/asyncjob.py b/virtManager/asyncjob.py index 64a070ac..e3d14513 100644 --- a/virtManager/asyncjob.py +++ b/virtManager/asyncjob.py @@ -293,6 +293,7 @@ class vmmAsyncJob(vmmGObjectUI): error = None details = None if self._error_info: + # pylint: disable=unpacking-non-sequence error, details = self._error_info self._finish_cb(error, details, *self._finish_args) diff --git a/virtManager/autodrawer.py b/virtManager/autodrawer.py index 5ac76c97..1b586db1 100644 --- a/virtManager/autodrawer.py +++ b/virtManager/autodrawer.py @@ -34,6 +34,9 @@ from virtManager import uiutil # pylint can't detect functions we inheirit from Gtk, ex: # OverBox.set_over: Instance of 'OverBox' has no 'remove' member +# pylint: disable=arguments-differ +# Newer pylint can detect, but warns that overridden arguments are wrong + def rect_print(name, rect): # For debugging diff --git a/virtManager/baseclass.py b/virtManager/baseclass.py index a4285a7b..aed0c46c 100644 --- a/virtManager/baseclass.py +++ b/virtManager/baseclass.py @@ -85,6 +85,9 @@ class vmmGObject(GObject.GObject): def _cleanup(self): raise NotImplementedError("_cleanup must be implemented in subclass") + # pylint: disable=arguments-differ + # Newer pylint can detect, but warns that overridden arguments are wrong + def connect(self, name, callback, *args): ret = GObject.GObject.connect(self, name, callback, *args) self._gobject_handles.append(ret) diff --git a/virtManager/connection.py b/virtManager/connection.py index 4c034b83..07326cde 100644 --- a/virtManager/connection.py +++ b/virtManager/connection.py @@ -865,7 +865,7 @@ class vmmConnection(vmmGObject): if obj: self.idle_add(obj.force_update_status, True) - if event == libvirt.VIR_NETWORK_EVENT_DEFINED: + if event == getattr(libvirt, "VIR_NETWORK_EVENT_DEFINED", 0): self.idle_add(obj.refresh_xml) else: self.schedule_priority_tick(pollnet=True, force=True) @@ -882,9 +882,9 @@ class vmmConnection(vmmGObject): logging.debug("Error registering domain events: %s", e) try: + eventid = getattr(libvirt, "VIR_NETWORK_EVENT_ID_LIFECYCLE", 0) self._network_cb_id = self.get_backend().networkEventRegisterAny( - None, libvirt.VIR_NETWORK_EVENT_ID_LIFECYCLE, - self._network_lifecycle_event, None) + None, eventid, self._network_lifecycle_event, None) self.using_network_events = True logging.debug("Using network events") except Exception, e: diff --git a/virtManager/console.py b/virtManager/console.py index ee12390f..b9f98de5 100644 --- a/virtManager/console.py +++ b/virtManager/console.py @@ -1534,6 +1534,7 @@ class vmmConsolePages(vmmGObjectUI): dy = 0 align_ratio = float(req.width) / float(req.height) + # pylint: disable=unpacking-non-sequence desktop_w, desktop_h = self.viewer.get_desktop_resolution() if desktop_h == 0: return diff --git a/virtManager/error.py b/virtManager/error.py index c1186a2d..8a788ce2 100644 --- a/virtManager/error.py +++ b/virtManager/error.py @@ -194,6 +194,7 @@ class vmmErrorDialog(vmmGObject): if not do_prompt: return default + # pylint: disable=unpacking-non-sequence res = self.warn_chkbox(text1=text1, text2=text2, chktext=chktext, buttons=Gtk.ButtonsType.YES_NO) diff --git a/virtManager/graphwidgets.py b/virtManager/graphwidgets.py index 9742c205..5748dba2 100644 --- a/virtManager/graphwidgets.py +++ b/virtManager/graphwidgets.py @@ -25,6 +25,9 @@ from gi.repository import Gtk # pylint can't detect functions we inheirit from Gtk, ex: # Instance of 'Sparkline' has no 'get_style_context' member +# pylint: disable=arguments-differ +# Newer pylint can detect, but warns that overridden arguments are wrong + def rect_print(name, rect): # For debugging diff --git a/virtManager/systray.py b/virtManager/systray.py index b02142f1..c1c4bf40 100644 --- a/virtManager/systray.py +++ b/virtManager/systray.py @@ -132,6 +132,7 @@ class vmmSystray(vmmGObject): return if self.systray_indicator: + # pylint: disable=maybe-no-member self.systray_icon = AppIndicator3.Indicator.new("virt-manager", "virt-manager-icon", AppIndicator3.IndicatorCategory.OTHER) @@ -155,12 +156,11 @@ class vmmSystray(vmmGObject): self.init_systray() else: if self.systray_indicator: + # pylint: disable=maybe-no-member + status = AppIndicator3.IndicatorStatus.PASSIVE if do_show: - self.systray_icon.set_status( - AppIndicator3.IndicatorStatus.ACTIVE) - else: - self.systray_icon.set_status( - AppIndicator3.IndicatorStatus.PASSIVE) + status = AppIndicator3.IndicatorStatus.ACTIVE + self.systray_icon.set_status(status) else: self.systray_icon.set_visible(do_show) |