215 time.sleep(0.5) |
215 time.sleep(0.5) |
216 self.connection.shutdown(socket.SHUT_RDWR) |
216 self.connection.shutdown(socket.SHUT_RDWR) |
217 self.connection.close() |
217 self.connection.close() |
218 |
218 |
219 if __name__ == '__main__': |
219 if __name__ == '__main__': |
220 if len(sys.argv) != 4: |
220 if len(sys.argv) != 5: |
221 print('Host, port and max. processes parameters are missing.' |
221 print('Host, port, max. processes and Python library path parameters' |
222 ' Aborting.') |
222 ' are missing. Aborting...') |
223 sys.exit(1) |
223 sys.exit(1) |
224 |
224 |
225 host, port, maxProcs = sys.argv[1:] |
225 host, port, maxProcs, pyLibraryPath = sys.argv[1:] |
|
226 |
|
227 # insert pyLibraryPath into the search path because external stuff might |
|
228 # be installed in the eric (virtual) environment |
|
229 sys.path.insert(1, pyLibraryPath) |
|
230 |
226 backgroundClient = BackgroundClient(host, int(port), int(maxProcs)) |
231 backgroundClient = BackgroundClient(host, int(port), int(maxProcs)) |
227 # Start the main loop |
232 # Start the main loop |
228 backgroundClient.run() |
233 backgroundClient.run() |
229 |
234 |
230 # |
235 # |