コード例 #1
0
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)
コード例 #2
0
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)
コード例 #3
0
ファイル: test_pyserver.py プロジェクト: wmyap/pydev
        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
コード例 #4
0
        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
コード例 #5
0
    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
コード例 #6
0
    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