125 self.__editorAct = None |
125 self.__editorAct = None |
126 self.__editorCodeStyleCheckerDialog = None |
126 self.__editorCodeStyleCheckerDialog = None |
127 |
127 |
128 def styleCheck(self, lang, filename, source, args): |
128 def styleCheck(self, lang, filename, source, args): |
129 """ |
129 """ |
130 Method to prepare a style check on one Python source file in another |
130 Public method to prepare a style check on one Python source file. |
131 task. |
|
132 |
131 |
133 @param lang language of the file or None to determine by internal |
132 @param lang language of the file or None to determine by internal |
134 algorithm (str or None) |
133 algorithm (str or None) |
135 @param filename source filename (string) |
134 @param filename source filename (string) |
136 @param source string containing the code to check (string) |
135 @param source string containing the code to check (string) |
148 data = [source, args] |
147 data = [source, args] |
149 self.backgroundService.enqueueRequest('style', lang, filename, data) |
148 self.backgroundService.enqueueRequest('style', lang, filename, data) |
150 |
149 |
151 def __translateStyleCheck(self, fn, codeStyleCheckerStats, results): |
150 def __translateStyleCheck(self, fn, codeStyleCheckerStats, results): |
152 """ |
151 """ |
153 Privat slot called after perfoming a style check on one file. |
152 Private slot called after perfoming a style check on one file. |
154 |
153 |
155 @param fn filename of the just checked file (str) |
154 @param fn filename of the just checked file (str) |
156 @param codeStyleCheckerStats stats of style and name check (dict) |
155 @param codeStyleCheckerStats stats of style and name check (dict) |
157 @param results tuple for each found violation of style (tuple of |
156 @param results tuple for each found violation of style (tuple of |
158 lineno (int), position (int), text (str), fixed (bool), |
157 lineno (int), position (int), text (str), fixed (bool), |
294 if not self.__projectBrowserAct in menu.actions(): |
293 if not self.__projectBrowserAct in menu.actions(): |
295 menu.addAction(self.__projectBrowserAct) |
294 menu.addAction(self.__projectBrowserAct) |
296 |
295 |
297 def __projectCodeStyleCheck(self): |
296 def __projectCodeStyleCheck(self): |
298 """ |
297 """ |
299 Public slot used to check the project files for code style. |
298 Private slot used to check the project files for code style. |
300 """ |
299 """ |
301 project = e5App().getObject("Project") |
300 project = e5App().getObject("Project") |
302 project.saveAllScripts() |
301 project.saveAllScripts() |
303 ppath = project.getProjectPath() |
302 ppath = project.getProjectPath() |
304 files = [os.path.join(ppath, file) |
303 files = [os.path.join(ppath, file) |