Beispiel #1
0
 def __editorTabnanny(self):
     """
     Private slot to handle the tabnanny context menu action of the editors.
     """
     editor = e5App().getObject("ViewManager").activeWindow()
     if editor is not None:
         if editor.checkDirty() and editor.getFileName() is not None:
             from CheckerPlugins.Tabnanny.TabnannyDialog import \
                 TabnannyDialog
             self.__editorTabnannyDialog = TabnannyDialog(self)
             self.__editorTabnannyDialog.show()
             self.__editorTabnannyDialog.start(editor.getFileName())
Beispiel #2
0
 def __projectTabnanny(self):
     """
     Private slot used to check the project files for bad indentations.
     """
     project = e5App().getObject("Project")
     project.saveAllScripts()
     ppath = project.getProjectPath()
     files = [os.path.join(ppath, file)
              for file in project.pdata["SOURCES"]
              if file.endswith(
                  tuple(Preferences.getPython("Python3Extensions")) +
                  tuple(Preferences.getPython("PythonExtensions")))]
     
     from CheckerPlugins.Tabnanny.TabnannyDialog import TabnannyDialog
     self.__projectTabnannyDialog = TabnannyDialog(self)
     self.__projectTabnannyDialog.show()
     self.__projectTabnannyDialog.prepare(files, project)
Beispiel #3
0
 def __projectBrowserTabnanny(self):
     """
     Private method to handle the tabnanny context menu action of the
     project sources browser.
     """
     browser = e5App().getObject("ProjectBrowser").getProjectBrowser(
         "sources")
     if browser.getSelectedItemsCount([ProjectBrowserFileItem]) > 1:
         fn = []
         for itm in browser.getSelectedItems([ProjectBrowserFileItem]):
             fn.append(itm.fileName())
     else:
         itm = browser.model().item(browser.currentIndex())
         try:
             fn = itm.fileName()
         except AttributeError:
             fn = itm.dirName()
     
     from CheckerPlugins.Tabnanny.TabnannyDialog import TabnannyDialog
     self.__projectBrowserTabnannyDialog = TabnannyDialog(self)
     self.__projectBrowserTabnannyDialog.show()
     self.__projectBrowserTabnannyDialog.start(fn)