--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py Tue Jun 20 14:45:35 2017 +0200 +++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py Wed Jun 21 19:40:59 2017 +0200 @@ -118,23 +118,33 @@ ignoreStarImportWarnings) -def syntaxAndPyflakesBatchCheck(argumentsList, send, fx, cancelled): +def syntaxAndPyflakesBatchCheck(argumentsList, send, fx, cancelled, + maxProcesses=0): """ Module function to check syntax for a batch of files. @param argumentsList list of arguments tuples as given for syntaxAndPyflakesCheck - @param send reference to send function (function) - @param fx registered service name (string) + @type list + @param send reference to send function + @type func + @param fx registered service name + @type str @param cancelled reference to function checking for a cancellation - (function) + @type func + @param maxProcesses number of processes to be used + @type int """ - try: - NumberOfProcesses = multiprocessing.cpu_count() - if NumberOfProcesses >= 1: - NumberOfProcesses -= 1 - except NotImplementedError: - NumberOfProcesses = 1 + if maxProcesses == 0: + # determine based on CPU count + try: + NumberOfProcesses = multiprocessing.cpu_count() + if NumberOfProcesses >= 1: + NumberOfProcesses -= 1 + except NotImplementedError: + NumberOfProcesses = 1 + else: + NumberOfProcesses = maxProcesses # Create queues taskQueue = multiprocessing.Queue()