PluginPyLint.py

branch
eric7
changeset 116
71d3a2e48265
parent 115
4a96d169c373
child 117
f8955e5dba87
equal deleted inserted replaced
115:4a96d169c373 116:71d3a2e48265
124 if isWindowsPlatform(): 124 if isWindowsPlatform():
125 # 125 #
126 # Windows 126 # Windows
127 # 127 #
128 try: 128 try:
129 import winreg 129 import winreg # noqa: I101, I103
130 except ImportError: 130 except ImportError:
131 import _winreg as winreg # __IGNORE_WARNING__ 131 import _winreg as winreg # __IGNORE_WARNING__
132 132
133 def getExePath(branch, access, versionStr): 133 def getExePath(branch, access, versionStr):
134 exes = [] 134 exes = []
463 "Warning: translation file '{0}' could not be" 463 "Warning: translation file '{0}' could not be"
464 " loaded.".format(translation) 464 " loaded.".format(translation)
465 ) 465 )
466 print("Using default.") 466 print("Using default.")
467 467
468 def __projectShowMenu(self, menuName, menu): 468 def __projectShowMenu(self, menuName, menu): # noqa: U100
469 """ 469 """
470 Private slot called, when the the project menu or a submenu is 470 Private slot called, when the the project menu or a submenu is
471 about to be shown. 471 about to be shown.
472 472
473 @param menuName name of the menu to be shown 473 @param menuName name of the menu to be shown
558 @param forProject flag indicating a run for the project 558 @param forProject flag indicating a run for the project
559 @type bool 559 @type bool
560 @param forEditor flag indicating a run for an editor 560 @param forEditor flag indicating a run for an editor
561 @type bool 561 @type bool
562 """ 562 """
563 from PyLintInterface.PyLintConfigDialog import PyLintConfigDialog
564 from PyLintInterface.PyLintExecDialog import PyLintExecDialog
565
563 if forEditor: 566 if forEditor:
564 parms = copy.deepcopy(self.__editorParms) 567 parms = copy.deepcopy(self.__editorParms)
565 editor = ericApp().getObject("ViewManager").getOpenEditor(mpName) 568 editor = ericApp().getObject("ViewManager").getOpenEditor(mpName)
566 majorVersionStr = editor.getLanguage() 569 majorVersionStr = editor.getLanguage()
567 else: 570 else:
574 self.tr("pylint"), 577 self.tr("pylint"),
575 self.tr("""The pylint executable could not be found."""), 578 self.tr("""The pylint executable could not be found."""),
576 ) 579 )
577 return 580 return
578 581
579 from PyLintInterface.PyLintConfigDialog import PyLintConfigDialog
580
581 dlg = PyLintConfigDialog(project.getProjectPath(), exe, parms, version) 582 dlg = PyLintConfigDialog(project.getProjectPath(), exe, parms, version)
582 if dlg.exec() == QDialog.DialogCode.Accepted: 583 if dlg.exec() == QDialog.DialogCode.Accepted:
583 args, parms = dlg.generateParameters() 584 args, parms = dlg.generateParameters()
584 self.__editorParms = copy.deepcopy(parms) 585 self.__editorParms = copy.deepcopy(parms)
585 if not forEditor: 586 if not forEditor:
586 project.setData("CHECKERSPARMS", "PYLINT", parms) 587 project.setData("CHECKERSPARMS", "PYLINT", parms)
587 588
588 # now do the call 589 # now do the call
589 from PyLintInterface.PyLintExecDialog import PyLintExecDialog
590
591 dlg2 = PyLintExecDialog() 590 dlg2 = PyLintExecDialog()
592 reportFile = parms.get("reportFile", None) 591 reportFile = parms.get("reportFile")
593 res = dlg2.start(args, mpName, reportFile, project.getProjectPath()) 592 res = dlg2.start(args, mpName, reportFile, project.getProjectPath())
594 if res: 593 if res:
595 dlg2.show() 594 dlg2.show()
596 if forProject: 595 if forProject:
597 self.__pylintPDialog = dlg2 596 self.__pylintPDialog = dlg2
703 except ImportError: 702 except ImportError:
704 pipInstall(["pylint"]) 703 pipInstall(["pylint"])
705 704
706 705
707 # 706 #
708 # eflag: noqa = M801 707 # eflag: noqa = M801, U200

eric ide

mercurial