Clean up pylint integration
- Drop no longer needed disable= bits - Use string names for all skipped pylint messages
This commit is contained in:
parent
01718bc408
commit
a398d245cb
4
setup.py
4
setup.py
|
@ -1,8 +1,6 @@
|
|||
#!/usr/bin/env python2
|
||||
# Copyright (C) 2013, 2014 Red Hat, Inc.
|
||||
|
||||
# pylint: disable=W0201
|
||||
# Attribute defined outside __init__: custom commands require breaking this
|
||||
|
||||
import datetime
|
||||
import glob
|
||||
|
@ -22,6 +20,8 @@ sysprefix = get_config_var("prefix")
|
|||
from virtcli import cliconfig
|
||||
|
||||
|
||||
# pylint: disable=attribute-defined-outside-init
|
||||
|
||||
def _generate_potfiles_in():
|
||||
def find(dirname, ext):
|
||||
ret = []
|
||||
|
|
|
@ -33,7 +33,7 @@ reload(cliconfig)
|
|||
|
||||
from tests import utils
|
||||
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
# Access to protected member, needed to unittest stuff
|
||||
|
||||
# Force certain helpers to return consistent values
|
||||
|
|
|
@ -25,7 +25,7 @@ from tests import utils
|
|||
qemuuri = "__virtinst_test__test:///default,caps=%s/tests/capabilities-xml/capabilities-kvm.xml,qemu,predictable" % os.getcwd()
|
||||
|
||||
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
# Access to protected member, needed to unittest stuff
|
||||
|
||||
class TestImageParser(unittest.TestCase):
|
||||
|
|
|
@ -34,29 +34,7 @@ load-plugins=
|
|||
# multiple time (only on the command line, not in the configuration file where
|
||||
# it should appear only once).
|
||||
|
||||
# Design: Things like 'too many arguments'
|
||||
# C0103: Name doesn't match some style regex
|
||||
# C0111: No docstring
|
||||
# C0301: Line too long
|
||||
# C0302: Too many lines in module
|
||||
# C0325: Superfluous parens
|
||||
# C0326: Bad whitespace
|
||||
# I0011: Warn about locally disabled pylint msgs
|
||||
# R0201: Method could be a function
|
||||
#
|
||||
# W0108: Lambda may not be necessary
|
||||
# W0142: Used * or ** magic*
|
||||
# W0603: Using the global statement
|
||||
# W0702: No exception type specified for 'catch'
|
||||
# W0703: Catch 'Exception'
|
||||
# W1401: Anomalous backslash in string
|
||||
#
|
||||
# May be useful to enable someday
|
||||
# Similarities: Code duplication
|
||||
# W1001: Use of 'property' on old style class,
|
||||
# pylint can't detect our Gtk subclasses are new style
|
||||
# W0511: FIXME and XXX: messages
|
||||
disable=Design,Similarities,C0103,C0111,C0301,C0302,C0325,C0326,I0011,R0201,W0108,W0142,W0603,W0702,W0703,W1401,W1001,W0511
|
||||
disable=Design,Similarities,invalid-name,missing-docstring,line-too-long,too-many-lines,superfluous-parens,bad-whitespace,locally-disabled,no-self-use,unnecessary-lambda,star-args,fixme,global-statement,bare-except,anomalous-backslash-in-string,broad-except
|
||||
|
||||
|
||||
[REPORTS]
|
||||
|
|
|
@ -23,7 +23,7 @@ from virtinst import StoragePool, StorageVolume
|
|||
|
||||
from tests import utils
|
||||
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
# Access to protected member, needed to unittest stuff
|
||||
|
||||
basepath = os.path.join(os.getcwd(), "tests", "storage-xml")
|
||||
|
|
|
@ -37,7 +37,7 @@ from virtinst.urlfetcher import UbuntuDistro
|
|||
from virtinst.urlfetcher import MandrivaDistro
|
||||
|
||||
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
# Access to protected member, needed to unittest stuff
|
||||
|
||||
OLD_FEDORA_URL = "https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/%s/Fedora/%s/os/"
|
||||
|
|
|
@ -31,7 +31,7 @@ from virtinst import VirtualVideoDevice
|
|||
# DON'T EDIT THIS. Use 'setup.py test --regenerate-output'
|
||||
REGENERATE_OUTPUT = False
|
||||
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
# Access to protected member, needed to unittest stuff
|
||||
|
||||
_capsprefix = ",caps=%s/tests/capabilities-xml/" % os.getcwd()
|
||||
|
|
|
@ -34,7 +34,7 @@ from virtinst import VirtualPanicDevice
|
|||
|
||||
from tests import utils
|
||||
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
# Access to protected member, needed to unittest stuff
|
||||
|
||||
_testconn = utils.open_testdriver()
|
||||
|
|
|
@ -90,7 +90,7 @@ class XMLParseTest(unittest.TestCase):
|
|||
return guest, outfile
|
||||
|
||||
def test000ClearProps(self):
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
# Access to protected member, needed to unittest stuff
|
||||
virtinst.xmlbuilder._seenprops = []
|
||||
|
||||
|
@ -1182,7 +1182,7 @@ class XMLParseTest(unittest.TestCase):
|
|||
utils.diff_compare(guest.get_xml_config(), outfile)
|
||||
|
||||
def testzzzzCheckProps(self):
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
# Access to protected member, needed to unittest stuff
|
||||
|
||||
# If a certain environment variable is set, XMLBuilder tracks
|
||||
|
|
|
@ -26,10 +26,8 @@ import signal
|
|||
import sys
|
||||
import traceback
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
from gi.repository import LibvirtGLib
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtinst import util as util
|
||||
from virtinst import cli as virtinstcli
|
||||
|
@ -62,7 +60,7 @@ def drop_tty():
|
|||
# tty. This prevents libvirt's SSH tunnels from prompting
|
||||
# for user input if SSH keys/agent aren't configured.
|
||||
if os.fork() != 0:
|
||||
os._exit(0) # pylint: disable=W0212
|
||||
os._exit(0) # pylint: disable=protected-access
|
||||
|
||||
os.setsid()
|
||||
|
||||
|
@ -174,7 +172,7 @@ def main():
|
|||
origargv = sys.argv
|
||||
try:
|
||||
sys.argv = origargv[:1] + leftovers[:]
|
||||
from gi.repository import Gtk # pylint: disable=E0611
|
||||
from gi.repository import Gtk
|
||||
leftovers = sys.argv[1:]
|
||||
|
||||
# This will error if Gtk wasn't correctly initialized
|
||||
|
|
|
@ -22,10 +22,8 @@ import logging
|
|||
import traceback
|
||||
import collections
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
# pylint: enable=E0611
|
||||
|
||||
import virtinst
|
||||
from virtinst import (VirtualChannelDevice, VirtualParallelDevice,
|
||||
|
|
|
@ -21,10 +21,8 @@ import logging
|
|||
import os
|
||||
import statvfs
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Gtk
|
||||
# pylint: enable=E0611
|
||||
|
||||
import virtinst
|
||||
from virtManager import uiutil
|
||||
|
|
|
@ -22,11 +22,9 @@ import logging
|
|||
import threading
|
||||
import traceback
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import GLib
|
||||
from gi.repository import Gtk
|
||||
# pylint: enable=E0611
|
||||
|
||||
import libvirt
|
||||
import urlgrabber
|
||||
|
|
|
@ -22,18 +22,12 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import GLib
|
||||
from gi.repository import Gtk
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtManager import uiutil
|
||||
|
||||
# pylint: disable=E1101
|
||||
# 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
|
||||
|
||||
|
|
|
@ -25,12 +25,10 @@ import traceback
|
|||
|
||||
from virtManager import config
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import GLib
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Gtk
|
||||
# pylint: enable=E0611
|
||||
|
||||
|
||||
class vmmGObject(GObject.GObject):
|
||||
|
|
|
@ -20,9 +20,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtManager.baseclass import vmmGObjectUI
|
||||
from virtManager.mediadev import MEDIA_FLOPPY
|
||||
|
|
|
@ -21,10 +21,8 @@
|
|||
import logging
|
||||
import os
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtManager import uiutil
|
||||
from virtManager.baseclass import vmmGObjectUI
|
||||
|
|
|
@ -20,11 +20,9 @@
|
|||
import os
|
||||
import logging
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gio
|
||||
from gi.repository import GLib
|
||||
from gi.repository import Gtk
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtinst import CPU
|
||||
from virtManager.keyring import vmmKeyring, vmmSecret
|
||||
|
@ -183,7 +181,7 @@ class vmmConfig(object):
|
|||
def check_inspection(self):
|
||||
try:
|
||||
# Check we can open the Python guestfs module.
|
||||
from guestfs import GuestFS # pylint: disable=F0401
|
||||
from guestfs import GuestFS # pylint: disable=import-error
|
||||
GuestFS(close_on_exit=False)
|
||||
return True
|
||||
except:
|
||||
|
|
|
@ -22,11 +22,9 @@ import os
|
|||
import logging
|
||||
import socket
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gio
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Gtk
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtManager import uiutil
|
||||
from virtManager.baseclass import vmmGObjectUI
|
||||
|
|
|
@ -18,10 +18,8 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GLib
|
||||
from gi.repository import Gio
|
||||
# pylint: enable=E0611
|
||||
|
||||
import logging
|
||||
import os
|
||||
|
@ -81,7 +79,7 @@ def creds_dialog_main(creds):
|
|||
"""
|
||||
Libvirt openAuth callback for username/password credentials
|
||||
"""
|
||||
from gi.repository import Gtk # pylint: disable=E0611
|
||||
from gi.repository import Gtk
|
||||
|
||||
dialog = Gtk.Dialog("Authentication required", None, 0,
|
||||
(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
# pylint: enable=E0611
|
||||
|
||||
import logging
|
||||
import os
|
||||
|
|
|
@ -20,14 +20,12 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import GtkVnc
|
||||
from gi.repository import SpiceClientGtk
|
||||
from gi.repository import SpiceClientGLib
|
||||
# pylint: enable=E0611
|
||||
|
||||
import libvirt
|
||||
|
||||
|
@ -282,7 +280,7 @@ class _Tunnel(object):
|
|||
os.dup(self._outfds[1].fileno())
|
||||
os.dup(self._errfds[1].fileno())
|
||||
os.execlp(*argv)
|
||||
os._exit(1) # pylint: disable=W0212
|
||||
os._exit(1) # pylint: disable=protected-access
|
||||
else:
|
||||
self._outfds[1].close()
|
||||
self._errfds[1].close()
|
||||
|
|
|
@ -22,11 +22,9 @@ import logging
|
|||
import threading
|
||||
import time
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
# pylint: enable=E0611
|
||||
|
||||
import virtinst
|
||||
from virtinst import util
|
||||
|
|
|
@ -18,10 +18,8 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
# pylint: enable=E0611
|
||||
|
||||
import logging
|
||||
|
||||
|
|
|
@ -23,10 +23,8 @@ import re
|
|||
|
||||
import ipaddr
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtinst import Network
|
||||
|
||||
|
|
|
@ -18,10 +18,8 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
# pylint: enable=E0611
|
||||
|
||||
import logging
|
||||
|
||||
|
|
|
@ -20,11 +20,9 @@
|
|||
|
||||
import logging
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtManager import uiutil
|
||||
from virtManager.baseclass import vmmGObjectUI
|
||||
|
|
|
@ -18,10 +18,8 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
# pylint: enable=E0611
|
||||
|
||||
import os
|
||||
import stat
|
||||
|
|
|
@ -21,11 +21,9 @@
|
|||
import logging
|
||||
import traceback
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
# pylint: enable=E0611
|
||||
|
||||
import libvirt
|
||||
|
||||
|
@ -780,7 +778,7 @@ class vmmDetails(vmmGObjectUI):
|
|||
show_open=False)
|
||||
for child in submenu.get_children():
|
||||
submenu.remove(child)
|
||||
newmenu.add(child) # pylint: disable=E1101
|
||||
newmenu.add(child)
|
||||
topmenu.set_submenu(newmenu)
|
||||
topmenu.show_all()
|
||||
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
# pylint: enable=E0611
|
||||
|
||||
import logging
|
||||
import os
|
||||
|
|
|
@ -18,11 +18,9 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GLib
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Gtk
|
||||
# pylint: enable=E0611
|
||||
|
||||
import logging
|
||||
import re
|
||||
|
|
|
@ -17,9 +17,7 @@
|
|||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
# MA 02110-1301 USA.
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gtk
|
||||
# pylint: enable=E0611
|
||||
|
||||
import logging
|
||||
import traceback
|
||||
|
@ -294,10 +292,6 @@ class _errorDialog (Gtk.MessageDialog):
|
|||
"""
|
||||
Custom error dialog with optional check boxes or details drop down
|
||||
"""
|
||||
# pylint: disable=E1101
|
||||
# pylint can't detect functions we inheirit from Gtk, ex:
|
||||
# Instance of '_errorDialog' has no 'set_title' member
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
Gtk.MessageDialog.__init__(self, *args, **kwargs)
|
||||
|
||||
|
@ -324,7 +318,8 @@ class _errorDialog (Gtk.MessageDialog):
|
|||
self.chk_align.add(self.chk_vbox)
|
||||
|
||||
self.chk_align.show_all()
|
||||
self.vbox.pack_start(self.chk_align, False, False, 0)
|
||||
self.vbox.pack_start( # pylint: disable=no-member
|
||||
self.chk_align, False, False, 0)
|
||||
|
||||
def init_details(self):
|
||||
# Init details buffer
|
||||
|
@ -342,7 +337,8 @@ class _errorDialog (Gtk.MessageDialog):
|
|||
details.set_border_width(6)
|
||||
sw.add(details)
|
||||
self.buf_expander.add(sw)
|
||||
self.vbox.pack_start(self.buf_expander, False, False, 0)
|
||||
self.vbox.pack_start( # pylint: disable=no-member
|
||||
self.buf_expander, False, False, 0)
|
||||
self.buf_expander.show_all()
|
||||
|
||||
def show_dialog(self, primary_text, secondary_text="",
|
||||
|
|
|
@ -19,10 +19,8 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import GObject
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtinst import VirtualFilesystem, StorageVolume
|
||||
from virtinst import util
|
||||
|
|
|
@ -19,10 +19,8 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import GObject
|
||||
# pylint: enable=E0611
|
||||
|
||||
import virtinst
|
||||
from virtManager import uiutil
|
||||
|
|
|
@ -16,14 +16,8 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Gtk
|
||||
# pylint: enable=E0611
|
||||
|
||||
# pylint: disable=E1101
|
||||
# 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
|
||||
|
|
|
@ -20,11 +20,9 @@
|
|||
|
||||
import logging
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtinst import VirtualDisk
|
||||
from virtinst import StoragePool
|
||||
|
|
|
@ -23,7 +23,7 @@ import logging
|
|||
import os
|
||||
import re
|
||||
|
||||
from guestfs import GuestFS # pylint: disable=F0401
|
||||
from guestfs import GuestFS # pylint: disable=import-error
|
||||
|
||||
from virtManager.baseclass import vmmGObject
|
||||
from virtManager.domain import vmmInspectionData
|
||||
|
|
|
@ -20,10 +20,8 @@
|
|||
|
||||
import logging
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gio
|
||||
from gi.repository import GLib
|
||||
# pylint: enable=E0611
|
||||
|
||||
|
||||
class vmmSecret(object):
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
# pylint: enable=E0611
|
||||
|
||||
import logging
|
||||
|
||||
|
|
|
@ -20,12 +20,10 @@
|
|||
|
||||
import logging
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import GdkPixbuf
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtinst import util
|
||||
|
||||
|
@ -241,7 +239,7 @@ class vmmManager(vmmGObjectUI):
|
|||
self.hostcpucol = None
|
||||
self.netcol = None
|
||||
|
||||
self.vmmenu.destroy() # pylint: disable=E1101
|
||||
self.vmmenu.destroy()
|
||||
self.vmmenu = None
|
||||
self.connmenu.destroy()
|
||||
self.connmenu = None
|
||||
|
@ -930,8 +928,7 @@ class vmmManager(vmmGObjectUI):
|
|||
# Popup the vm menu
|
||||
vm = model[_iter][ROW_HANDLE]
|
||||
self.vmmenu.update_widget_states(vm)
|
||||
self.vmmenu.popup( # pylint: disable=E1101
|
||||
None, None, None, None, 0, event.time)
|
||||
self.vmmenu.popup(None, None, None, None, 0, event.time)
|
||||
else:
|
||||
# Pop up connection menu
|
||||
conn = model[_iter][ROW_HANDLE]
|
||||
|
|
|
@ -17,9 +17,7 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gtk
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtManager import uiutil
|
||||
from virtManager.baseclass import vmmGObjectUI
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
# pylint: enable=E0611
|
||||
|
||||
import logging
|
||||
|
||||
|
|
|
@ -22,11 +22,9 @@ import traceback
|
|||
import logging
|
||||
import threading
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import GLib
|
||||
from gi.repository import Gtk
|
||||
# pylint: enable=E0611
|
||||
|
||||
import libvirt
|
||||
from virtinst import util
|
||||
|
|
|
@ -19,10 +19,8 @@
|
|||
|
||||
import logging
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import GObject
|
||||
# pylint: enable=E0611
|
||||
|
||||
import virtinst
|
||||
from virtManager import uiutil
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gio
|
||||
# pylint: enable=E0611
|
||||
|
||||
import logging
|
||||
import time
|
||||
|
@ -74,7 +72,7 @@ def packagekit_install(parent, package_list):
|
|||
try:
|
||||
# Need to import GdkX11 just to get access to get_xid function
|
||||
# This will likely fail on wayland in the future, so ignore errors
|
||||
from gi.repository import GdkX11 # pylint: disable=E0611
|
||||
from gi.repository import GdkX11 # pylint: disable=no-name-in-module
|
||||
ignore = GdkX11
|
||||
|
||||
if parent and parent.topwin.get_window():
|
||||
|
|
|
@ -20,10 +20,8 @@
|
|||
|
||||
import logging
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtManager import uiutil
|
||||
from virtManager.baseclass import vmmGObjectUI
|
||||
|
|
|
@ -25,12 +25,10 @@ import pty
|
|||
import fcntl
|
||||
import logging
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import GLib
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Vte
|
||||
# pylint: enable=E0611
|
||||
|
||||
import libvirt
|
||||
|
||||
|
|
|
@ -24,12 +24,10 @@ import logging
|
|||
import os
|
||||
import StringIO
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import GdkPixbuf
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Pango
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtinst import DomainSnapshot
|
||||
from virtinst import util
|
||||
|
|
|
@ -20,10 +20,8 @@
|
|||
|
||||
import logging
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Gtk
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtManager import host
|
||||
from virtManager.asyncjob import vmmAsyncJob
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtinst import pollhelpers
|
||||
from virtinst import StoragePool, StorageVolume
|
||||
|
|
|
@ -20,17 +20,15 @@
|
|||
|
||||
import logging
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Gtk
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtManager import vmmenu
|
||||
from virtManager.baseclass import vmmGObject
|
||||
from virtManager.error import vmmErrorDialog
|
||||
|
||||
try:
|
||||
from gi.repository import AppIndicator3 # pylint: disable=E0611
|
||||
from gi.repository import AppIndicator3 # pylint: disable=no-name-in-module
|
||||
except:
|
||||
AppIndicator3 = None
|
||||
|
||||
|
|
|
@ -18,10 +18,8 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Gtk
|
||||
# pylint: enable=E0611
|
||||
|
||||
try:
|
||||
import gi
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
# pylint: disable=E0611
|
||||
from gi.repository import Gtk
|
||||
# pylint: enable=E0611
|
||||
|
||||
|
||||
####################################################################
|
||||
|
@ -28,9 +26,6 @@ from gi.repository import Gtk
|
|||
####################################################################
|
||||
|
||||
class _VMMenu(Gtk.Menu):
|
||||
# pylint: disable=E1101
|
||||
# pylint can't detect functions we inheirit from Gtk, ex self.add
|
||||
|
||||
def __init__(self, src, current_vm_cb, show_open=True):
|
||||
Gtk.Menu.__init__(self)
|
||||
self._parent = src
|
||||
|
@ -74,9 +69,6 @@ class _VMMenu(Gtk.Menu):
|
|||
|
||||
|
||||
class VMShutdownMenu(_VMMenu):
|
||||
# pylint: disable=E1101
|
||||
# pylint can't detect functions we inheirit from Gtk, ex self.add
|
||||
|
||||
def _init_state(self):
|
||||
self._add_action(_("_Reboot"), "reboot")
|
||||
self._add_action(_("_Shut Down"), "shutdown")
|
||||
|
@ -103,9 +95,6 @@ class VMShutdownMenu(_VMMenu):
|
|||
|
||||
|
||||
class VMActionMenu(_VMMenu):
|
||||
# pylint: disable=E1101
|
||||
# pylint can't detect functions we inheirit from Gtk, ex self.add
|
||||
|
||||
def _init_state(self):
|
||||
self._add_action(_("_Run"), "run", Gtk.STOCK_MEDIA_PLAY)
|
||||
self._add_action(_("_Pause"), "suspend", Gtk.STOCK_MEDIA_PAUSE)
|
||||
|
|
|
@ -347,7 +347,7 @@ def _run_console(args):
|
|||
return child
|
||||
|
||||
os.execvp(args[0], args)
|
||||
os._exit(1) # pylint: disable=W0212
|
||||
os._exit(1) # pylint: disable=protected-access
|
||||
|
||||
|
||||
def _gfx_console(guest):
|
||||
|
@ -926,7 +926,8 @@ class _VirtCLIArgument(object):
|
|||
elif self.setter_cb:
|
||||
self.setter_cb(opts, inst, self.cliname, val)
|
||||
else:
|
||||
exec("inst." + self.attrname + " = val") # pylint: disable=W0122
|
||||
exec( # pylint: disable=exec-used
|
||||
"inst." + self.attrname + " = val")
|
||||
|
||||
|
||||
class VirtOptionString(object):
|
||||
|
@ -1135,7 +1136,7 @@ class VirtCLIParser(object):
|
|||
for optstr in optlist:
|
||||
optinst = inst
|
||||
if self.devclass and not inst:
|
||||
optinst = self.devclass(guest.conn) # pylint: disable=E1102
|
||||
optinst = self.devclass(guest.conn) # pylint: disable=not-callable
|
||||
|
||||
try:
|
||||
devs = self._parse_single_optstr(guest, optstr, optinst)
|
||||
|
@ -1966,11 +1967,11 @@ class ParserRNG(VirtCLIParser):
|
|||
def _parse(self, optsobj, inst):
|
||||
opts = optsobj.opts
|
||||
|
||||
# pylint: disable=W0201
|
||||
# pylint: disable=attribute-defined-outside-init
|
||||
# Defined outside init, but its easier this way
|
||||
self._cli_backend_mode = "connect"
|
||||
self._cli_backend_type = "udp"
|
||||
# pylint: enable=W0201
|
||||
# pylint: enable=attribute-defined-outside-init
|
||||
|
||||
if opts.get("type", "").startswith("/"):
|
||||
# Allow --rng /dev/random
|
||||
|
|
|
@ -185,7 +185,7 @@ class VirtualConnection(object):
|
|||
Returns a list of Guest() objects
|
||||
"""
|
||||
if self.cb_fetch_all_guests:
|
||||
return self.cb_fetch_all_guests() # pylint: disable=E1102
|
||||
return self.cb_fetch_all_guests() # pylint: disable=not-callable
|
||||
return self._fetch_all_guests_cached()
|
||||
|
||||
def _fetch_all_pools_cached(self):
|
||||
|
@ -206,7 +206,7 @@ class VirtualConnection(object):
|
|||
Returns a list of StoragePool objects
|
||||
"""
|
||||
if self.cb_fetch_all_pools:
|
||||
return self.cb_fetch_all_pools() # pylint: disable=E1102
|
||||
return self.cb_fetch_all_pools() # pylint: disable=not-callable
|
||||
return self._fetch_all_pools_cached()
|
||||
|
||||
def _fetch_all_vols_cached(self):
|
||||
|
@ -236,12 +236,12 @@ class VirtualConnection(object):
|
|||
Returns a list of StorageVolume objects
|
||||
"""
|
||||
if self.cb_fetch_all_vols:
|
||||
return self.cb_fetch_all_vols() # pylint: disable=E1102
|
||||
return self.cb_fetch_all_vols() # pylint: disable=not-callable
|
||||
return self._fetch_all_vols_cached()
|
||||
|
||||
def clear_cache(self, pools=False):
|
||||
if self.cb_clear_cache:
|
||||
self.cb_clear_cache(pools=pools) # pylint: disable=E1102
|
||||
self.cb_clear_cache(pools=pools) # pylint: disable=not-callable
|
||||
return
|
||||
|
||||
if pools:
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
_SENTINEL = -1234
|
||||
_allvariants = {}
|
||||
from datetime import datetime
|
||||
from gi.repository import Libosinfo as libosinfo # pylint: disable=E0611
|
||||
from gi.repository import Libosinfo as libosinfo
|
||||
|
||||
_aliases = {
|
||||
"altlinux" : "altlinux1.0",
|
||||
|
|
|
@ -495,7 +495,7 @@ def get_cache_dir():
|
|||
ret = ""
|
||||
try:
|
||||
# We don't want to depend on glib for virt-install
|
||||
from gi.repository import GLib # pylint: disable=E0611
|
||||
from gi.repository import GLib
|
||||
ret = GLib.get_user_cache_dir()
|
||||
except ImportError:
|
||||
pass
|
||||
|
|
|
@ -260,7 +260,7 @@ class Disk(object):
|
|||
if hashlib:
|
||||
if "sha256" in self.csum:
|
||||
csumvalue = self.csum["sha256"]
|
||||
m = hashlib.sha256() # pylint: disable=E1101
|
||||
m = hashlib.sha256()
|
||||
|
||||
elif "sha1" in self.csum:
|
||||
csumvalue = self.csum["sha1"]
|
||||
|
|
|
@ -29,7 +29,7 @@ import libxml2
|
|||
from virtinst import util
|
||||
|
||||
|
||||
# pylint: disable=W0212
|
||||
# pylint: disable=protected-access
|
||||
# This whole file is calling around into non-public functions that we
|
||||
# don't want regular API users to touch
|
||||
|
||||
|
|
Loading…
Reference in New Issue