11 from PyQt4.QtCore import Qt, QCoreApplication |
11 from PyQt4.QtCore import Qt, QCoreApplication |
12 from PyQt4.QtGui import QDialog, QTreeWidgetItem |
12 from PyQt4.QtGui import QDialog, QTreeWidgetItem |
13 |
13 |
14 from . import pep8 |
14 from . import pep8 |
15 from .Pep8NamingChecker import Pep8NamingChecker |
15 from .Pep8NamingChecker import Pep8NamingChecker |
|
16 from .Pep257Checker import Pep257Checker |
16 |
17 |
17 from .Ui_Pep8StatisticsDialog import Ui_Pep8StatisticsDialog |
18 from .Ui_Pep8StatisticsDialog import Ui_Pep8StatisticsDialog |
18 |
19 |
19 import UI.PixmapCache |
20 import UI.PixmapCache |
20 |
21 |
53 message = QCoreApplication.translate( |
54 message = QCoreApplication.translate( |
54 "pep8", pep8.pep8_messages[code]) |
55 "pep8", pep8.pep8_messages[code]) |
55 elif code in Pep8NamingChecker.Messages: |
56 elif code in Pep8NamingChecker.Messages: |
56 message = QCoreApplication.translate( |
57 message = QCoreApplication.translate( |
57 "Pep8NamingChecker", Pep8NamingChecker.Messages[code]) |
58 "Pep8NamingChecker", Pep8NamingChecker.Messages[code]) |
|
59 elif code in Pep257Checker.Messages: |
|
60 message = QCoreApplication.translate( |
|
61 "Pep257Checker", Pep257Checker.Messages[code]) |
58 else: |
62 else: |
59 continue |
63 continue |
60 self.__createItem(stats[code], code, message) |
64 self.__createItem(stats[code], code, message) |
61 totalIssues += stats[code] |
65 totalIssues += stats[code] |
62 |
66 |
88 itm.setIcon(1, UI.PixmapCache.getIcon("warning.png")) |
92 itm.setIcon(1, UI.PixmapCache.getIcon("warning.png")) |
89 elif code.startswith("E"): |
93 elif code.startswith("E"): |
90 itm.setIcon(1, UI.PixmapCache.getIcon("syntaxError.png")) |
94 itm.setIcon(1, UI.PixmapCache.getIcon("syntaxError.png")) |
91 elif code.startswith("N"): |
95 elif code.startswith("N"): |
92 itm.setIcon(1, UI.PixmapCache.getIcon("namingError.png")) |
96 itm.setIcon(1, UI.PixmapCache.getIcon("namingError.png")) |
|
97 elif code.startswith("D"): |
|
98 itm.setIcon(1, UI.PixmapCache.getIcon("docstringError.png")) |
93 |
99 |
94 itm.setTextAlignment(0, Qt.AlignRight) |
100 itm.setTextAlignment(0, Qt.AlignRight) |
95 itm.setTextAlignment(1, Qt.AlignHCenter) |
101 itm.setTextAlignment(1, Qt.AlignHCenter) |