eric7.Plugins.CheckerPlugins.SyntaxChecker.pyCheckSyntax

Module implementing the syntax check for Python 3.

Global Attributes

VcsConflictMarkerRegExpList

Classes

None

Functions

__pySyntaxAndPyflakesCheck Function to compile one Python source file to Python bytecode and to perform a pyflakes check.
extractLineFlags Function to extract flags starting and ending with '__' from a line comment.
initBatchService Initialize the batch service and return the entry point.
initService Initialize the service and return the entry point.
pySyntaxAndPyflakesBatchCheck Module function to check syntax for a batch of files.
pySyntaxAndPyflakesCheck Function to compile one Python source file to Python bytecode and to perform a pyflakes check.
showwarning
workerTask Module function acting as the parallel worker for the syntax check.


__pySyntaxAndPyflakesCheck

__pySyntaxAndPyflakesCheck(filename, codestring, checkFlakes=True, ignoreStarImportWarnings=False, additionalBuiltins=None, )

Function to compile one Python source file to Python bytecode and to perform a pyflakes check.

filename (str)
source filename
codestring (str)
string containing the code to compile
checkFlakes (bool)
flag indicating to do a pyflakes check
ignoreStarImportWarnings (bool)
flag indicating to ignore 'star import' warnings
additionalBuiltins (list of str)
list of names pyflakes should consider as builtins
Return:
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.
Return Type:
list of dict
Up


extractLineFlags

extractLineFlags(line, startComment=")

Function to extract flags starting and ending with '__' from a line comment.

line (str)
line to extract flags from
startComment (str)
string identifying the start of the comment
endComment (str)
string identifying the end of a comment
flagsLine (bool)
flag indicating to check for a flags only line
Return:
list containing the extracted flags
Return Type:
list of str
Up


initBatchService

initBatchService()

Initialize the batch service and return the entry point.

Return:
the entry point for the background client
Return Type:
function
Up


initService

initService()

Initialize the service and return the entry point.

Return:
the entry point for the background client
Return Type:
function
Up


pySyntaxAndPyflakesBatchCheck

pySyntaxAndPyflakesBatchCheck(argumentsList, send, fx, cancelled, maxProcesses=0)

Module function to check syntax for a batch of files.

argumentsList (list)
list of arguments tuples as given for pySyntaxAndPyflakesCheck
send (function)
reference to send function
fx (str)
registered service name
cancelled (function)
reference to function checking for a cancellation
maxProcesses (int)
number of processes to be used
Up


pySyntaxAndPyflakesCheck

pySyntaxAndPyflakesCheck(filename, codestring, checkFlakes=True, ignoreStarImportWarnings=False, additionalBuiltins=None, )

Function to compile one Python source file to Python bytecode and to perform a pyflakes check.

filename (str)
source filename
codestring (str)
string containing the code to compile
checkFlakes (bool)
flag indicating to do a pyflakes check
ignoreStarImportWarnings (bool)
flag indicating to ignore 'star import' warnings
additionalBuiltins (list of str)
list of names pyflakes should consider as builtins
Return:
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.
Return Type:
list of dict
Up


showwarning

showwarning(message, category, filename, lineno, file=None, line=None, )
Up


workerTask

workerTask(inputQueue, outputQueue)

Module function acting as the parallel worker for the syntax check.

inputQueue (multiprocessing.Queue)
input queue
outputQueue (multiprocessing.Queue)
output queue
Up