summaryrefslogtreecommitdiff
path: root/gui.py
diff options
context:
space:
mode:
authorPete <sneakypete81@gmail.com>2013-09-07 17:23:36 +0100
committerPete <sneakypete81@gmail.com>2013-09-07 17:23:36 +0100
commit526c6660711e8a700f8ff42e404234faa6a5abca (patch)
treede433c8b0ddbfd2e604f1838e392473373f1ec1e /gui.py
parent55932500a1709b8cda792aad7ab87ca0a63279fa (diff)
downloadpylint-git-526c6660711e8a700f8ff42e404234faa6a5abca.tar.gz
Updated GUI reporter to use Message object.
Removed unused msgs[] attribute. --HG-- branch : reporter_message_fix
Diffstat (limited to 'gui.py')
-rw-r--r--gui.py30
1 files changed, 9 insertions, 21 deletions
diff --git a/gui.py b/gui.py
index 79a408902..0ee5974cf 100644
--- a/gui.py
+++ b/gui.py
@@ -39,10 +39,10 @@ COLORS = {'(I)':'lightblue',
def convert_to_string(msg):
"""make a string representation of a message"""
- if (msg[4] != ""):
- return "(" + msg[0] + ") " + msg[3] + "." + msg[4] + " [" + msg[5] + "]: " + msg[6]
- else:
- return "(" + msg[0] + ") " + msg[3] + " [" + msg[5] + "]: " + msg[6]
+ module_object = msg.module
+ if msg.obj:
+ module_object += ".%s" % msg.obj
+ return "(%s) %s [%d]: %s" % (msg.C, module_object, msg.line, msg.msg)
class BasicStream(object):
'''
@@ -327,12 +327,7 @@ class LintGui(object):
self.lbMessages.delete(0, END)
self.visible_msgs = []
for msg in self.msgs:
-
- # 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)()):
+ if (self.msg_type_dict.get(msg.C)()):
self.visible_msgs.append(msg)
msg_str = convert_to_string(msg)
self.lbMessages.insert(END, msg_str)
@@ -361,12 +356,8 @@ class LintGui(object):
#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_type)()):
+ if (self.msg_type_dict.get(msg.C)()):
self.visible_msgs.append(msg)
msg_str = convert_to_string(msg)
self.lbMessages.insert(END, msg_str)
@@ -478,18 +469,15 @@ class LintGui(object):
return
msg = self.visible_msgs[int(selected[0])]
- filename = msg[2]
- fileline = int(msg[5])
-
- scroll = fileline - 3
+ scroll = msg.line - 3
if scroll < 0:
scroll = 0
- self.tabs["Source File"] = open(filename, "r").readlines()
+ self.tabs["Source File"] = open(msg.path, "r").readlines()
self.box.set("Source File")
self.refresh_results_window()
self.results.yview(scroll)
- self.results.select_set(fileline - 1)
+ self.results.select_set(msg.line - 1)
def lint_thread(module, reporter, gui):