60 |
60 |
61 self.backgroundService = e5App().getObject("BackgroundService") |
61 self.backgroundService = e5App().getObject("BackgroundService") |
62 |
62 |
63 path = os.path.join( |
63 path = os.path.join( |
64 os.path.dirname(__file__), 'CheckerPlugins', 'Tabnanny') |
64 os.path.dirname(__file__), 'CheckerPlugins', 'Tabnanny') |
65 for lang in ['Python2', 'Python3']: |
65 self.backgroundService.serviceConnect( |
66 self.backgroundService.serviceConnect( |
66 'indent', 'Python2', path, 'Tabnanny', |
67 'indent', lang, path, 'Tabnanny', |
67 lambda *args: self.indentChecked.emit(*args), |
68 lambda *args: self.indentChecked.emit(*args), |
68 onErrorCallback=self.serviceErrorPy2) |
69 lambda fx, fn, ver, msg: self.indentChecked.emit( |
69 self.backgroundService.serviceConnect( |
70 fn, True, "1", msg)) |
70 'indent', 'Python3', path, 'Tabnanny', |
71 |
71 lambda *args: self.indentChecked.emit(*args), |
|
72 onErrorCallback=self.serviceErrorPy3) |
|
73 |
|
74 def __serviceError(self, fn, msg): |
|
75 """ |
|
76 Private slot handling service errors. |
|
77 |
|
78 @param fn file name (string) |
|
79 @param msg message text (string) |
|
80 """ |
|
81 self.indentChecked.emit(fn, True, "1", msg) |
|
82 |
|
83 def serviceErrorPy2(self, fx, lang, fn, msg): |
|
84 """ |
|
85 Public method handling service errors for Python 2. |
|
86 |
|
87 @param fx service name (string) |
|
88 @param lang language (string) |
|
89 @param fn file name (string) |
|
90 @param msg message text (string) |
|
91 """ |
|
92 if fx == 'indent' and lang == 'Python2': |
|
93 self.__serviceError(fn, msg) |
|
94 |
|
95 def serviceErrorPy3(self, fx, lang, fn, msg): |
|
96 """ |
|
97 Public method handling service errors for Python 2. |
|
98 |
|
99 @param fx service name (string) |
|
100 @param lang language (string) |
|
101 @param fn file name (string) |
|
102 @param msg message text (string) |
|
103 """ |
|
104 if fx == 'indent' and lang == 'Python3': |
|
105 self.__serviceError(fn, msg) |
|
106 |
72 def __initialize(self): |
107 def __initialize(self): |
73 """ |
108 """ |
74 Private slot to (re)initialize the plugin. |
109 Private slot to (re)initialize the plugin. |
75 """ |
110 """ |
76 self.__projectAct = None |
111 self.__projectAct = None |