def StartServer(host, port, client_port): #replace exit (see comments on method) #note that this does not work in jython!!! (sys method can't be replaced). sys.exit = DoExit interpreter = InterpreterInterface(host, client_port, threading.currentThread()) start_new_thread(start_server,(host, port, interpreter)) process_exec_queue(interpreter)
def create_connections(self, p1=50002): """ Creates the connections needed for testing. """ server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((pycompletionserver.HOST, p1)) server.listen(1) # socket to receive messages. t = pycompletionserver.CompletionServer(p1) t.exit_process_on_kill = False start_new_thread(t.run, ()) s, addr = server.accept() return t, s
def createConnections(self, p1=50002): ''' Creates the connections needed for testing. ''' server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((pycompletionserver.HOST, p1)) server.listen(1) #socket to receive messages. t = pycompletionserver.CompletionServer(p1) t.exit_process_on_kill = False start_new_thread(t.run, ()) s, addr = server.accept() return t, s
def run(self): try: from _pydev_runfiles import pydev_runfiles_parallel_client #TODO: Support Jython: # #For jython, instead of using sys.executable, we should use: #r'D:\bin\jdk_1_5_09\bin\java.exe', #'-classpath', #'D:/bin/jython-2.2.1/jython.jar', #'org.python.util.jython', args = [ sys.executable, pydev_runfiles_parallel_client.__file__, str(self.job_id), str(self.port), str(self.verbosity), ] if self.coverage_output_file and self.coverage_include: args.append(self.coverage_output_file) args.append(self.coverage_include) import subprocess if False: proc = subprocess.Popen(args, env=os.environ, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) _pydev_thread.start_new_thread(self._reader_thread, (proc.stdout, sys.stdout)) _pydev_thread.start_new_thread(target=self._reader_thread, args=(proc.stderr, sys.stderr)) else: proc = subprocess.Popen(args, env=os.environ, shell=False) proc.wait() finally: self.finished = True
def run(self): try: import pydev_runfiles_parallel_client #TODO: Support Jython: # #For jython, instead of using sys.executable, we should use: #r'D:\bin\jdk_1_5_09\bin\java.exe', #'-classpath', #'D:/bin/jython-2.2.1/jython.jar', #'org.python.util.jython', args = [ sys.executable, pydev_runfiles_parallel_client.__file__, str(self.job_id), str(self.port), str(self.verbosity), ] if self.coverage_output_file and self.coverage_include: args.append(self.coverage_output_file) args.append(self.coverage_include) import subprocess if False: proc = subprocess.Popen(args, env=os.environ, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) _pydev_thread.start_new_thread(self._reader_thread,(proc.stdout, sys.stdout)) _pydev_thread.start_new_thread(target=self._reader_thread,args=(proc.stderr, sys.stderr)) else: proc = subprocess.Popen(args, env=os.environ, shell=False) proc.wait() finally: self.finished = True