eric7.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.
setArguments Public method to set additional arguments to be used by the syntax check.
start Public slot to start the syntax check.
startForBrowser Public slot to start the syntax check for the project sources browser.

Static Methods

None

SyntaxCheckerDialog (Constructor)

SyntaxCheckerDialog(parent=None)

Constructor

parent (QWidget)
reference to the parent widget

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 str)
list of files to be checked

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 (str)
file name of file
line (int or str)
line number of faulty source
index (int)
index number of fault
error (str)
error text
sourcecode (str)
faulty line of code
isWarning (bool)
flag indicating a warning message

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 (str)
filename of the checked file
problems (dict)
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)

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 (str)
optional sourcestring

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 (QAbstractButton)
button that was clicked

SyntaxCheckerDialog.on_resultList_itemActivated

on_resultList_itemActivated(itm, col)

Private slot to handle the activation of an item.

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

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 str)
list of filenames
project (Project)
reference to the project object

SyntaxCheckerDialog.setArguments

setArguments(args)

Public method to set additional arguments to be used by the syntax check.

args (tuple of Any)
tuple containing the additional arguments

SyntaxCheckerDialog.start

start(fn, codestring="")

Public slot to start the syntax check.

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

SyntaxCheckerDialog.startForBrowser

startForBrowser(fn)

Public slot to start the syntax check for the project sources browser.

fn (str or list of str)
file or list of files or directory to be checked
Up