# eric6.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog

Module implementing a simple Python syntax checker.

### Global Attributes

None

### Classes

SyntaxCheckerDialog | Class implementing a dialog to display the results of a syntax check run.

### Functions

None

## SyntaxCheckerDialog

Class implementing a dialog to display the results of a syntax check run.

### Derived from

QDialog, Ui_SyntaxCheckerDialog

### Class Attributes

errorRole
filenameRole
indexRole
lineRole
warningRole

### Class Methods

None

### Methods

SyntaxCheckerDialog | Constructor
__batchFinished | Private slot handling the completion of a batch job.
__clearErrors | Private method to clear all error and warning markers of open editors to be checked.
__createErrorItem | Private slot to create a new error item in the result list.
__createResultItem | Private method to create an entry in the result list.
__finish | Private slot called when the syntax check finished or the user pressed the button.
__processError | Private slot to process an error indication from the service.
__processResult | Private slot to display the reported messages.
__resort | Private method to resort the tree.
check | Public method to start a check for one file.
checkBatch | Public method to start a style check batch job.
on_buttonBox_clicked | Private slot called by a button of the button box clicked.
on_resultList_itemActivated | Private slot to handle the activation of an item.
on_showButton_clicked | Private slot to handle the "Show" button press.
on_startButton_clicked | Private slot to start a syntax check run.
prepare | Public method to prepare the dialog with a list of filenames.
start | Public slot to start the syntax check.

### Static Methods

None

#### SyntaxCheckerDialog (Constructor)

SyntaxCheckerDialog(parent=None)

Constructor

parent
  The parent widget. (QWidget)

#### SyntaxCheckerDialog.__batchFinished

__batchFinished()

Private slot handling the completion of a batch job.

#### SyntaxCheckerDialog.__clearErrors

__clearErrors(files)

Private method to clear all error and warning markers of open editors to be checked.

files
  list of files to be checked (list of string)

#### SyntaxCheckerDialog.__createErrorItem

__createErrorItem(filename, message)

Private slot to create a new error item in the result list.

filename (str)
  name of the file
message (str)
  error message

#### SyntaxCheckerDialog.__createResultItem

__createResultItem(filename, line, index, error, sourcecode, isWarning=False)

Private method to create an entry in the result list.

filename
  file name of file (string)
line
  line number of faulty source (integer or string)
index
  index number of fault (integer)
error
  error text (string)
sourcecode
  faulty line of code (string)
isWarning
  flag indicating a warning message (boolean)

#### SyntaxCheckerDialog.__finish

__finish()

Private slot called when the syntax check finished or the user pressed the button.

#### SyntaxCheckerDialog.__processError

__processError(fn, msg)

Private slot to process an error indication from the service.

fn (str)
  filename of the file
msg (str)
  error message

#### SyntaxCheckerDialog.__processResult

__processResult(fn, problems)

Private slot to display the reported messages.

fn
  filename of the checked file (str)
problems
  dictionary with the keys 'error' and 'warnings' which hold a list containing details about the error/ warnings (file name, line number, column, codestring (only at syntax errors), the message) (dict)

#### SyntaxCheckerDialog.__resort

__resort()

Private method to resort the tree.

#### SyntaxCheckerDialog.check

check(codestring='')

Public method to start a check for one file.

The results are reported to the __processResult slot.

codestring=
  optional sourcestring (str)

#### SyntaxCheckerDialog.checkBatch

checkBatch()

Public method to start a style check batch job.

The results are reported to the __processResult slot.

#### SyntaxCheckerDialog.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called by a button of the button box clicked.

button
  button that was clicked (QAbstractButton)

#### SyntaxCheckerDialog.on_resultList_itemActivated

on_resultList_itemActivated(itm, col)

Private slot to handle the activation of an item.

itm
  reference to the activated item (QTreeWidgetItem)
col
  column the item was activated in (integer)

#### SyntaxCheckerDialog.on_showButton_clicked

on_showButton_clicked()

Private slot to handle the "Show" button press.

#### SyntaxCheckerDialog.on_startButton_clicked

on_startButton_clicked()

Private slot to start a syntax check run.

#### SyntaxCheckerDialog.prepare

prepare(fileList, project)

Public method to prepare the dialog with a list of filenames.

fileList
  list of filenames (list of strings)
project
  reference to the project object (Project)

#### SyntaxCheckerDialog.start

start(fn, codestring="")

Public slot to start the syntax check.

fn
  file or list of files or directory to be checked (string or list of strings)
codestring
  string containing the code to be checked (string). If this is given, fn must be a single file name.

Up