Ejemplo n.º 1
0
 def render(self):
     actions = {
         APPROVE: self.approve,
         BLOCK: self.block
     }
     while True:
         self.clear()
         message = Message.get_next_unprocessed(self.redis)
         if message:
             print(message.pstr())
             answers = self.ask(PROMPT)
             if answers['action'] in actions:
                 actions[answers['action']](message)
             self.clear()
         else:
             print('No new messages :(')
         answers = self.ask(CONTINUE_PROMPT)
         if not answers['action']:
             return
Ejemplo n.º 2
0
 def process_old(self):
     while True:
         message = Message.get_next_unprocessed(self.redis)
         if not message:
             break
         self.moderate_message(message)