Fix pylint detection, and clean up the fallout
This commit is contained in:
parent
f42f3afe42
commit
f4aa83e10f
|
@ -18,6 +18,8 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
import logging
|
||||
|
||||
import gtk
|
||||
|
||||
from virtManager.baseclass import vmmGObjectUI
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
# MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
import logging
|
||||
|
||||
import virtManager.uihelpers as uihelpers
|
||||
import virtManager.util as util
|
||||
from virtManager.baseclass import vmmGObjectUI
|
||||
|
|
|
@ -69,7 +69,7 @@ def _do_we_have_session():
|
|||
|
||||
try:
|
||||
ret = manager.GetSessionForUnixProcess(pid)
|
||||
logging.debug("Found ConsoleKit session=%s" % ret)
|
||||
logging.debug("Found ConsoleKit session=%s", ret)
|
||||
except:
|
||||
logging.exception("Failed to lookup pid session")
|
||||
return False
|
||||
|
@ -1575,7 +1575,8 @@ class vmmConnection(vmmGObject):
|
|||
except Exception, e:
|
||||
logging.exception("Tick for VM '%s' failed", vm.get_name())
|
||||
if (isinstance(e, libvirt.libvirtError) and
|
||||
e.get_error_code() == libvirt.VIR_ERR_SYSTEM_ERROR):
|
||||
(getattr(e, "get_error_code")() ==
|
||||
libvirt.VIR_ERR_SYSTEM_ERROR)):
|
||||
# Try a simple getInfo call to see if conn was dropped
|
||||
self.vmm.getInfo()
|
||||
logging.debug("vm tick raised system error but "
|
||||
|
|
|
@ -22,7 +22,6 @@ import logging
|
|||
|
||||
import gtk
|
||||
|
||||
import virtManager.util as util
|
||||
from virtManager.baseclass import vmmGObjectUI
|
||||
|
||||
PREFS_PAGE_STATS = 0
|
||||
|
@ -174,7 +173,6 @@ class vmmPreferences(vmmGObjectUI):
|
|||
val = self.config.get_keys_combination()
|
||||
|
||||
# We convert keysyms to names
|
||||
print val
|
||||
if not val:
|
||||
keystr = "Control_L+Alt_L"
|
||||
else:
|
||||
|
@ -192,7 +190,6 @@ class vmmPreferences(vmmGObjectUI):
|
|||
keystr = keystr + "+" + gtk.gdk.keyval_name(key)
|
||||
|
||||
|
||||
prefs_button = self.widget("prefs-keys-grab-changebtn")
|
||||
self.widget("prefs-keys-grab-sequence").set_text(keystr)
|
||||
|
||||
def refresh_confirm_forcepoweroff(self, ignore1=None, ignore2=None,
|
||||
|
|
|
@ -18,9 +18,6 @@ PYLINT_FILES="virtManager/ _virt-manager virtManagerTui/ _virt-manager-tui"
|
|||
# Don't print pylint config warning
|
||||
NO_PYL_CONFIG=".*No config file found.*"
|
||||
|
||||
# The gettext function is installed in the builtin namespace
|
||||
GETTEXT_VAR="Undefined variable '_'"
|
||||
|
||||
# Optional modules that may not be available
|
||||
UNABLE_IMPORT="Unable to import '(appindicator)"
|
||||
|
||||
|
@ -44,6 +41,10 @@ INFER_ERRORS="Instance of '${INFER_LIST}.*not be inferred"
|
|||
# Hacks for testing
|
||||
TEST_HACKS="protected member (_is_virtinst_test_uri|_open_test_uri)"
|
||||
|
||||
# cli/gui diff causes confusion
|
||||
STUBCLASS="Instance of 'stubclass'"
|
||||
DBUSINTERFACE="Instance of 'Interface'"
|
||||
|
||||
DMSG=""
|
||||
skipmsg() {
|
||||
DMSG="${DMSG},$1"
|
||||
|
@ -86,23 +87,26 @@ SHOW_REPORT="n"
|
|||
AWK=awk
|
||||
[ `uname -s` = 'SunOS' ] && AWK=nawk
|
||||
|
||||
|
||||
echo "Running pylint"
|
||||
pylint --ignore=$IGNOREFILES $PYLINT_FILES \
|
||||
--additional-builtins=_ \
|
||||
--reports=$SHOW_REPORT \
|
||||
--output-format=colorized \
|
||||
--dummy-variables-rgx="dummy|ignore.*|.*_ignore" \
|
||||
--disable=${DMSG}\
|
||||
--disable=${DCHECKERS} 2>&1 | \
|
||||
egrep -ve "$NO_PYL_CONFIG" \
|
||||
-ve "$GETTEXT_VAR" \
|
||||
-ve "$OS_EXIT" \
|
||||
-ve "$BUILTIN_TYPE" \
|
||||
-ve "$INFER_ERRORS" \
|
||||
-ve "$MAIN_NONETYPE" \
|
||||
-ve "$TEST_HACKS" \
|
||||
-ve "$UNABLE_IMPORT" \
|
||||
-ve "$STYLE_ATTACH" \
|
||||
-ve "$VBOX_ATTACH" | \
|
||||
egrep -ve "$NO_PYL_CONFIG" \
|
||||
-ve "$OS_EXIT" \
|
||||
-ve "$BUILTIN_TYPE" \
|
||||
-ve "$STUBCLASS" \
|
||||
-ve "$DBUSINTERFACE" \
|
||||
-ve "$MAIN_NONETYPE" \
|
||||
-ve "$TEST_HACKS" \
|
||||
-ve "$UNABLE_IMPORT" \
|
||||
-ve "$STYLE_ATTACH" \
|
||||
-ve "$VBOX_PACK" \
|
||||
-ve "$INFER_ERRORS" | \
|
||||
$AWK '\
|
||||
# Strip out any "*** Module name" lines if we dont list any errors for them
|
||||
BEGIN { found=0; cur_line="" }
|
||||
|
|
Loading…
Reference in New Issue