Anonymous avatar Anonymous committed 24a0879

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

Comments (0)

Files changed (2)

 ====================
 
 --
+    * #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)
 
         #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')
                 #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')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.