def run(self): opt.parse_options(sys.argv[1:]) while (True): self.print_text_display() chan_list = map(lambda x: x.soc, self.tabs) # klog("doing select...") (rs, _, _) = select.select(chan_list + [sys.stdin], [], []) # klog("after select...") if len(rs) > 0: chan_to_read = rs[0] if chan_to_read == sys.stdin: c = sys.stdin.read(1) self.process_input_char(c) else: p = self.find_process_from_chan(chan_to_read) m = p.read_message() p.process_message(m)
def run(self): opt.parse_options(sys.argv[1:]) while (True): self.print_text_display() chan_list = map(lambda x: x.soc, self.tabs) # klog("doing select...") (rs, _, _ ) = select.select(chan_list + [sys.stdin], [], []) # klog("after select...") if len(rs) > 0: chan_to_read = rs[0] if chan_to_read == sys.stdin: c = sys.stdin.read(1) self.process_input_char(c) else: p = self.find_process_from_chan(chan_to_read) m = p.read_message() p.process_message(m)
def run(self): self.soc = socket.fromfd(int(sys.argv[1]), msg.FAMILY, msg.TYPE) self.name = sys.argv[2] opt.parse_options(sys.argv[3:]) try: f = open("cookies/" + self.name) self.cookie_db = pickle.load(f) f.close except: clog("cookie file loading failed") self.cookie_db = {} signal.signal(signal.SIGINT, signal_handler) while (True): m = self.read_message() self.process_message(m)
def run(self): self.soc = socket.fromfd(int(sys.argv[1]), msg.FAMILY, msg.TYPE) self.name = sys.argv[2] opt.parse_options(sys.argv[3:]) try: f = open("cookies/" + self.name) self.cookie_db = pickle.load(f) f.close except : clog("cookie file loading failed") self.cookie_db = {} signal.signal(signal.SIGINT, signal_handler) while (True): m = self.read_message() self.process_message(m)