VultureChecker/VultureCheckerService.py

changeset 45
232ed15782bb
parent 44
9be43ed02aaa
child 47
4e19b213fc3f
equal deleted inserted replaced
44:9be43ed02aaa 45:232ed15782bb
100 # Tell child processes to stop 100 # Tell child processes to stop
101 for i in range(NumberOfProcesses): 101 for i in range(NumberOfProcesses):
102 taskQueue.put('STOP') 102 taskQueue.put('STOP')
103 103
104 104
105 def worker(input, output): 105 def worker(inputQueue, outputQueue):
106 """ 106 """
107 Module function acting as the parallel worker for the cyclomatic 107 Module function acting as the parallel worker for the cyclomatic
108 complexity calculation. 108 complexity calculation.
109 109
110 @param input input queue 110 @param inputQueue input queue
111 @type multiprocessing.Queue 111 @type multiprocessing.Queue
112 @param output output queue 112 @param outputQueue output queue
113 @type multiprocessing.Queue 113 @type multiprocessing.Queue
114 """ 114 """
115 for filename, source in iter(input.get, 'STOP'): 115 for filename, source in iter(inputQueue.get, 'STOP'):
116 result = __analyze(filename, source) 116 result = __analyze(filename, source)
117 output.put((filename, result)) 117 outputQueue.put((filename, result))
118 118
119 119
120 def __analyze(filename, text=""): 120 def __analyze(filename, text=""):
121 """ 121 """
122 Private function to analyze one Python file. 122 Private function to analyze one Python file.

eric ide

mercurial