def runtime_setup(self, exepath, argv, image_name, image_args_idx): fullpath = exepath self._executable_path.set(fullpath) for i in range(image_args_idx, len(argv)): self.set_system_attribute(SYSTEM_ATTRIBUTE_IMAGE_ARGS_INDEX + i - image_args_idx, argv[i]) self.set_system_attribute(SYSTEM_ATTRIBUTE_IMAGE_NAME_INDEX, image_name) self.image_loaded.activate() self.init_system_attributes(argv) from rpython.rlib.rsocket import rsocket_startup rsocket_startup()
def entry_point(argv): rsignal.pypysig_setflag(rsignal.SIGINT) rsocket.rsocket_startup() constructor = bytecode.constructor.BytecodeConstructor() if len(argv) < 3: print_usage(argv[0]) return 1 trace_fd = None mode = argv[1] if mode == 'exec': program = argv[2] argv = argv[2:] sys_caller = sys_calls.Perform(program) elif mode == 'trace' and len(argv) >= 4: program = argv[3] trace_fd = open(argv[2], 'w') argv = argv[3:] sys_caller = sys_calls.TraceProxy(sys_calls.Perform(program), trace_fd) elif mode == 'replay' and len(argv) >= 4: program = argv[3] argv = argv[3:] trace_fd = open(argv[2], 'r') sys_caller = sys_calls.Replay(trace_fd) else: print_usage(argv[0]) return 1 with open(program, 'r') as fd: bytecode.read.read_bytecode(fd, constructor) arguments = [operators.list.DList([data.ByteString(arg) for arg in argv])] try: ex = executor.execute(sys_caller, constructor.get_program(), arguments) finally: if trace_fd: trace_fd.close() return 0
def startup(self, space): from rpython.rlib.rsocket import rsocket_startup rsocket_startup() from pypy.module._socket.interp_func import State space.fromcache(State).startup(space)
def startup(self, space): from rpython.rlib.rsocket import rsocket_startup rsocket_startup()
def startup(space, argv): from rpython.rlib.rsocket import rsocket_startup rsocket_startup()