diff options
author | Omega Weapon <OmegaPhil+hg@gmail.com> | 2012-11-12 13:49:31 +0100 |
---|---|---|
committer | Omega Weapon <OmegaPhil+hg@gmail.com> | 2012-11-12 13:49:31 +0100 |
commit | 72110cf2990d3a91f1ee3aafc90578f35f829f85 (patch) | |
tree | 63ba523566a4a2da42627e638f59c0296ad8c1f9 | |
parent | a03eb51ff9b17dbe59f84a03b37e4434a6ae4c77 (diff) | |
download | pylint-72110cf2990d3a91f1ee3aafc90578f35f829f85.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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gui.py | 13 |
2 files changed, 16 insertions, 2 deletions
@@ -2,6 +2,11 @@ ChangeLog for PyLint ==================== -- + * #110838: fix pylint-gui crash when include-ids is activated (patch by + Omega Weapon) + + +-- * #106534: add --ignore-imports option to code similarity checking and 'symilar' command line tool (patch by Ry4an Brase) @@ -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') |