7 Module implementing the code style checker plug-in. |
7 Module implementing the code style checker plug-in. |
8 """ |
8 """ |
9 |
9 |
10 import os |
10 import os |
11 import textwrap |
11 import textwrap |
|
12 import contextlib |
12 |
13 |
13 from PyQt5.QtCore import QObject, pyqtSignal, QCoreApplication |
14 from PyQt5.QtCore import QObject, pyqtSignal, QCoreApplication |
14 |
15 |
15 from E5Gui.E5Application import e5App |
16 from E5Gui.E5Application import e5App |
16 from E5Gui.E5Action import E5Action |
17 from E5Gui.E5Action import E5Action |
415 """ |
416 """ |
416 Private slot called, when an editor was closed. |
417 Private slot called, when an editor was closed. |
417 |
418 |
418 @param editor reference to the editor (QScintilla.Editor) |
419 @param editor reference to the editor (QScintilla.Editor) |
419 """ |
420 """ |
420 try: |
421 with contextlib.suppress(ValueError): |
421 self.__editors.remove(editor) |
422 self.__editors.remove(editor) |
422 except ValueError: |
|
423 pass |
|
424 |
423 |
425 def __editorShowMenu(self, menuName, menu, editor): |
424 def __editorShowMenu(self, menuName, menu, editor): |
426 """ |
425 """ |
427 Private slot called, when the the editor context menu or a submenu is |
426 Private slot called, when the the editor context menu or a submenu is |
428 about to be shown. |
427 about to be shown. |