149 |
149 |
150 def __getPythonOptions(self): |
150 def __getPythonOptions(self): |
151 """ |
151 """ |
152 Private method to determine the syntax check options. |
152 Private method to determine the syntax check options. |
153 |
153 |
154 @return state of checkFlakes and ignoreStarImportWarnings (bool, bool) |
154 @return tuple containing a flag indicating to perform a pyflakes check and |
|
155 a flag indicating to ignore star import warnings |
|
156 @rtype tuple of (bool, bool) |
155 """ |
157 """ |
156 checkFlakes = Preferences.getFlakes("IncludeInSyntaxCheck") |
158 checkFlakes = Preferences.getFlakes("IncludeInSyntaxCheck") |
157 ignoreStarImportWarnings = Preferences.getFlakes("IgnoreStarImportWarnings") |
159 ignoreStarImportWarnings = Preferences.getFlakes("IgnoreStarImportWarnings") |
158 additionalBuiltins = Preferences.getFlakes("AdditionalBuiltins") |
160 return checkFlakes, ignoreStarImportWarnings |
159 return checkFlakes, ignoreStarImportWarnings, additionalBuiltins |
|
160 |
161 |
161 def __translateSyntaxCheck(self, fn, problems): |
162 def __translateSyntaxCheck(self, fn, problems): |
162 """ |
163 """ |
163 Private slot to translate the resulting messages. |
164 Private slot to translate the resulting messages. |
164 |
165 |
401 """ |
402 """ |
402 from eric7.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog import ( |
403 from eric7.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog import ( |
403 SyntaxCheckerDialog, |
404 SyntaxCheckerDialog, |
404 ) |
405 ) |
405 |
406 |
|
407 project = ericApp().getObject("Project") |
406 editor = ericApp().getObject("ViewManager").activeWindow() |
408 editor = ericApp().getObject("ViewManager").activeWindow() |
407 if editor is not None: |
409 if editor is not None: |
408 self.__editorSyntaxCheckerDialog = SyntaxCheckerDialog() |
410 self.__editorSyntaxCheckerDialog = SyntaxCheckerDialog() |
|
411 if editor.isPy3File(): |
|
412 self.__editorSyntaxCheckerDialog.setArguments( |
|
413 ( |
|
414 project.getData("CHECKERSPARMS", "SyntaxChecker", {}).get( |
|
415 "AdditionalBuiltins", [] |
|
416 ), |
|
417 ) |
|
418 if editor.isProjectFile() |
|
419 else (Preferences.getFlakes("AdditionalBuiltins"),) |
|
420 ) |
409 self.__editorSyntaxCheckerDialog.show() |
421 self.__editorSyntaxCheckerDialog.show() |
410 if editor.isJavascriptFile(): |
422 if editor.isJavascriptFile(): |
411 unnamed = "Unnamed.js" |
423 unnamed = "Unnamed.js" |
412 else: |
424 else: |
413 unnamed = "Unnamed.py" |
425 unnamed = "Unnamed.py" |