예제 #1
0
 def _watchdog_key(self):
     """
     接受按键, 存入queue
     """
     while True:
         k = getch.getch()
         self.key_queue.put(k)
예제 #2
0
파일: douban.py 프로젝트: PDonin/douban.fm
 def _watchdog_key(self):
     """
     接受按键, 存入queue
     """
     while True:
         k = getch.getch()
         self.key_queue.put(k)
예제 #3
0
 def _controller(self):
     """
     接受按键, 存入queue
     """
     while not self.quit:
         k = getch.getch()
         self.queue.put(k)
         if k == 'o' or k == 'q' or k == 'h':
             break
예제 #4
0
 def _controller(self):
     """
     接受按键, 存入queue
     """
     while not self.quit:
         k = getch.getch()
         self.queue.put(k)
         if k == self.keys['QUIT']:
             break
예제 #5
0
 def _controller(self):
     """
     接受按键, 存入queue
     """
     while not self.quit:
         k = getch.getch()
         self.queue.put(k)
         if k == self.keys['QUIT']:
             break
예제 #6
0
 def _controller(self):
     """
     接受按键, 存入queue
     """
     while not self.quit:
         k = getch.getch()
         logger.info(k)
         self.queue.put(k)
         if k == 'q':
             break
예제 #7
0
 def _controller(self):
     """
     接受按键, 存入queue
     """
     while not self.quit:
         k = getch.getch()
         logger.info(k)
         self.queue.put(k)
         if k == 'q':
             break
예제 #8
0
 def _controller(self):
     """
     接受按键, 存入queue
     """
     while not self.quit:
         k = getch.getch()
         self.queue.put(k)
         # 此处退出时需要做一下判断, 不然会引发切换线程无法读取的bug
         if k == 'o' or k == 'q' or k == 'h' or k == 't':
             break
예제 #9
0
 def _controller(self):
     """
     接受按键, 存入queue
     """
     while not self.quit:
         k = getch.getch()
         self.queue.put(k)
         # 此处退出时需要做一下判断, 不然会引发切换线程无法读取的bug
         # TODO: 按键映射
         if k == 'o' or k == 'q' or k == 'h' or k == 't':
             break
예제 #10
0
 def _controller(self):
     """
     接受按键, 存入queue
     """
     try:
         while not self.quit:
             k = getch.getch()
             self.queue.put(k)
             # 此处退出时需要做一下判断, 不然会引发切换线程无法读取的bug
             # TODO: 按键映射
             if k == 'o' or k == 'q' or k == 'h' or k == 't':
                 break
     except:
         pass
예제 #11
0
 def _controller(self):
     """
     接受按键, 存入queue
     """
     k = getch.getch()
     self.queue.put(k)
예제 #12
0
파일: douban.py 프로젝트: ChenghaoQ/Pyex
 def _watchdog_key(self):
     # why not use the instant one
     while True:
         k = getch.getch()
         self.key_queue.put(k)