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
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!
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: # XXX There is no unit test for raising the exception # for other errnos. See #4285. if e.errno != errno.EAGAIN: raise
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!