summaryrefslogtreecommitdiff
path: root/gui.py
diff options
context:
space:
mode:
authorOmega Weapon <OmegaPhil+hg@gmail.com>2012-11-12 13:49:31 +0100
committerOmega Weapon <OmegaPhil+hg@gmail.com>2012-11-12 13:49:31 +0100
commitde5e24e5808386da779523a558bdb4c8e2f1a5b8 (patch)
tree2acef2463b3396e493be5f3b342bbf5727cd6632 /gui.py
parent4b322badb81a08e70b96481e1993fb22687b8b53 (diff)
downloadpylint-git-de5e24e5808386da779523a558bdb4c8e2f1a5b8.tar.gz
Make pylint-gui cope with '--include-ids'. Closes #110838
When pylint's '--include-ids' option is used, the message type is not a single character string but includes the ID as well - change to deal with this when processing messages. Originally reported at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=689172 --HG-- branch : stable
Diffstat (limited to 'gui.py')
-rw-r--r--gui.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/gui.py b/gui.py
index 9023fae32..2c9c1bc6a 100644
--- a/gui.py
+++ b/gui.py
@@ -318,7 +318,12 @@ class LintGui:
#clear the window
self.lbMessages.delete(0, END)
for msg in self.msgs:
- if (self.msg_type_dict.get(msg[0])()):
+
+ # Obtaining message type (pylint's '--include-ids' appends the
+ # ID to this letter, so 1 character long is not guaranteed)
+ msg_type = msg[0][0]
+
+ if (self.msg_type_dict.get(msg_type)()):
msg_str = convert_to_string(msg)
self.lbMessages.insert(END, msg_str)
fg_color = COLORS.get(msg_str[:3], 'black')
@@ -346,8 +351,12 @@ class LintGui:
#adding message to list of msgs
self.msgs.append(msg)
+ # Obtaining message type (pylint's '--include-ids' appends the
+ # ID to this letter, so 1 character long is not guaranteed)
+ msg_type = msg[0][0]
+
#displaying msg if message type is selected in check box
- if (self.msg_type_dict.get(msg[0])()):
+ if (self.msg_type_dict.get(msg_type)()):
msg_str = convert_to_string(msg)
self.lbMessages.insert(END, msg_str)
fg_color = COLORS.get(msg_str[:3], 'black')