Ejemplo n.º 1
0
 def wakeUp(self):
     """Send a byte to my connection.
     """
     try:
         util.untilConcludes(self.w.send, "x")
     except socket.error, (err, msg):
         if err != errno.WSAEWOULDBLOCK:
             raise
Ejemplo n.º 2
0
    def emit(self, eventDict):
        text = textFromEventDict(eventDict)
        if text is None:
            return

        timeStr = self.formatTime(eventDict['time'])
        fmtDict = {'system': eventDict['system'], 'text': text.replace("\n", "\n\t")}
        msgStr = _safeFormat("[%(system)s] %(text)s\n", fmtDict)

        util.untilConcludes(self.write, timeStr + " " + msgStr)
        util.untilConcludes(self.flush)  # Hoorj!
Ejemplo n.º 3
0
 def wakeUp(self):
     """Write one byte to the pipe, and flush it.
     """
     # We don't use fdesc.writeToFD since we need to distinguish
     # between EINTR (try again) and EAGAIN (do nothing).
     if self.o is not None:
         try:
             util.untilConcludes(os.write, self.o, "x")
         except OSError, e:
             if e.errno != errno.EAGAIN:
                 raise