Beispiel #1
0
 def event(self, ev):
     """ Handle events sent to the object. """
     if ev.type() == MessageReceivedEvent.Type:
         if self.logMessages:
             self.logger.info("Received message %s.", repr(ev.m))
         try:
             self.messages.match(ev.m)
         except Exception:
             Process.logger().exception("An exception was raised by the process")
         return True
     else:
         return False
Beispiel #2
0
 def __init__(self, logMessages=False):
     super(GuiProcess, self).__init__()
     self.pid = Process.attach("GUI", self)
     self.messages = PatternMatcher()
     self.isOpen = True
     self.logger = Process.logger()
     self.logMessages = logMessages