# eric7.Plugins.PluginSyntaxChecker

Module implementing the Syntax Checker plugin.

### Global Attributes

__header__
error

### Classes

SyntaxCheckerPlugin | Class implementing the Syntax Checker plugin.

### Functions

None

## SyntaxCheckerPlugin

Class implementing the Syntax Checker plugin.

### Derived from

QObject

### Class Attributes

None

### Class Methods

None

### Methods

SyntaxCheckerPlugin | Constructor
__editorClosed | Private slot called, when an editor was closed.
__editorOpened | Private slot called, when a new editor was opened.
__editorShowMenu | Private slot called, when the the editor context menu or a submenu is about to be shown.
__editorSyntaxCheck | Private slot to handle the syntax check context menu action of the editors.
__getPythonOptions | Private method to determine the syntax check options.
__initialize | Private slot to (re)initialize the plugin.
__projectBrowserShowMenu | Private slot called, when the the project browser menu or a submenu is about to be shown.
__projectBrowserSyntaxCheck | Private method to handle the syntax check context menu action of the project sources browser.
__projectShowMenu | Private slot called, when the the project menu or a submenu is about to be shown.
__projectSyntaxCheck | Private slot used to check the project files for syntax errors.
__translateSyntaxCheck | Private slot to translate the resulting messages.
activate | Public method to activate this plugin.
deactivate | Public method to deactivate this plugin.

### Static Methods

None

#### SyntaxCheckerPlugin (Constructor)

SyntaxCheckerPlugin(ui)

Constructor

ui (UI.UserInterface)
  reference to the user interface object

#### SyntaxCheckerPlugin.__editorClosed

__editorClosed(editor)

Private slot called, when an editor was closed.

editor (QScintilla.Editor)
  reference to the editor

#### SyntaxCheckerPlugin.__editorOpened

__editorOpened(editor)

Private slot called, when a new editor was opened.

editor (QScintilla.Editor)
  reference to the new editor

#### SyntaxCheckerPlugin.__editorShowMenu

__editorShowMenu(menuName, menu, editor)

Private slot called, when the the editor context menu or a submenu is about to be shown.

menuName (str)
  name of the menu to be shown
menu (QMenu)
  reference to the menu
editor (QScintilla.Editor)
  reference to the editor

#### SyntaxCheckerPlugin.__editorSyntaxCheck

__editorSyntaxCheck()

Private slot to handle the syntax check context menu action of the editors.

#### SyntaxCheckerPlugin.__getPythonOptions

__getPythonOptions()

Private method to determine the syntax check options.

Return:
  tuple containing a flag indicating to perform a pyflakes check and a flag indicating to ignore star import warnings

Return Type:
  tuple of (bool, bool)

#### SyntaxCheckerPlugin.__initialize

__initialize()

Private slot to (re)initialize the plugin.

#### SyntaxCheckerPlugin.__projectBrowserShowMenu

__projectBrowserShowMenu(menuName, menu)

Private slot called, when the the project browser menu or a submenu is about to be shown.

menuName (str)
  name of the menu to be shown
menu (QMenu)
  reference to the menu

#### SyntaxCheckerPlugin.__projectBrowserSyntaxCheck

__projectBrowserSyntaxCheck()

Private method to handle the syntax check context menu action of the project sources browser.

#### SyntaxCheckerPlugin.__projectShowMenu

__projectShowMenu(menuName, _menu)

Private slot called, when the the project menu or a submenu is about to be shown.

menuName (str)
  name of the menu to be shown
_menu (QMenu)
  reference to the menu (unused)

#### SyntaxCheckerPlugin.__projectSyntaxCheck

__projectSyntaxCheck()

Private slot used to check the project files for syntax errors.

#### SyntaxCheckerPlugin.__translateSyntaxCheck

__translateSyntaxCheck(fn, problems)

Private slot to translate the resulting messages.

If checkFlakes is True, warnings contains a list of strings containing the warnings (marker, file name, line number, message) The values are only valid, if nok is False.

fn (str)
  filename of the checked file
problems (list of dict)
  list of dictionaries with the keys 'error', 'py_warnings' and 'warnings' which contain a tuple with details about the syntax error or a list of tuples with details about Python warnings and PyFlakes warnings. Each tuple contains the file name, line number, column, code string (only for syntax errors), the message and an optional list with arguments for the message.

#### SyntaxCheckerPlugin.activate

activate()

Public method to activate this plugin.

Return:
  tuple of None and activation status

Return Type:
  bool

#### SyntaxCheckerPlugin.deactivate

deactivate()

Public method to deactivate this plugin.

Up