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