Example #1
0
 def run(self):
     try:
         while not self.isInterrupted() and self.processMsg(self.readInt()):
             pass
     except (Exception, ), ex:
         errmsg = ("Exception while processing message.  ")
         logger().exception(errmsg)
         if self.parent().isConnected():
             self.eWrapper().error(ex)
Example #2
0
 def run(self):
     try:
         while not self.isInterrupted() and self.processMsg(self.readInt()):
             pass
     except (Exception, ), ex:
         errmsg = ("Exception while processing message.  ")
         logger().exception(errmsg)
         if self.parent().isConnected():
             self.eWrapper().error(ex)
Example #3
0
 def run(self):
     """ generated source for method run """
     try:
         #  loop until thread is terminated
         while not self.isInterrupted() and self.processMsg(self.readInt()):
             pass
     except Exception as ex:
         errmsg = ("Exception while processing message.  ")
         logger().exception(errmsg)
         if self.parent().isConnected():
             self.eWrapper().error(ex)
     if self.parent().isConnected():
         self.m_parent.close()
Example #4
0
 def run(self):
     """ generated source for method run """
     try:
         #  loop until thread is terminated
         while not self.isInterrupted() and self.processMsg(self.readInt()):
             pass
     except Exception as ex:
         errmsg = ("Exception while processing message.  ")
         logger().exception(errmsg)
         if self.parent().isConnected():
             self.eWrapper().error(ex)
     if self.parent().isConnected():
         self.m_parent.close()
Example #5
0
    def __init__(self, listeners=None, messageTypes=None):
        """ Initializer.

        @param listeners=None mapping of existing listeners
        @param types=None method name to message type lookup
        """
        self.listeners = listeners if listeners else {}
        self.messageTypes = messageTypes if messageTypes else message.registry
        self.logger = logger.logger()
Example #6
0
    def __init__(self, listeners=None, messageTypes=None):
        """ Initializer.

        @param listeners=None mapping of existing listeners
        @param types=None method name to message type lookup
        """
        self.listeners = listeners if listeners else {}
        self.messageTypes = messageTypes if messageTypes else message.registry
        self.logger = logger.logger()
Example #7
0
    def enableLogging(self, enable=True):
        """ Enable or disable logging of all messages.

        @param enable if True (default), enables logging; otherwise disables
        @return True if enabled, False otherwise
        """
        if enable:
            self.logger = logger()
            self.registerAll(self.logMessage)
        else:
            self.unregisterAll(self.logMessage)
        return enable
Example #8
0
    def enableLogging(self, enable=True):
        """ Enable or disable logging of all messages.

        @param enable if True (default), enables logging; otherwise disables
        @return True if enabled, False otherwise
        """
        if enable:
            self.logger = logger()
            self.receiver.registerAll(self.logMessage)
        else:
            self.receiver.unregisterAll(self.logMessage)
        return enable