def HandleOutput(self,message):
# debug("QueueOutput on thread %d, flags %d with '%s'...\n" % (win32api.GetCurrentThreadId(), self.writeQueueing, message ))
self.outputQueue.put(message)
if win32api.GetCurrentThreadId() != self.mainThreadId:
pass
# debug("not my thread - ignoring queue options!\n")
elif self.writeQueueing==flags.WQ_LINE:
pos = message.rfind('\n')
if pos>=0:
# debug("Line queueing - forcing flush\n")
self.QueueFlush()
return
elif self.writeQueueing==flags.WQ_NONE:
# debug("WQ_NONE - flushing!\n")
self.QueueFlush()
return
# Let our idle handler get it - wake it up
try:
win32ui.GetMainFrame().PostMessage(win32con.WM_USER) # Kick main thread off.
except win32ui.error:
# This can happen as the app is shutting down, so we send it to the C++ debugger
win32api.OutputDebugString(message)
# delegate certain fns to my view.
评论列表
文章目录