winout.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:CodeReader 作者: jasonrbr 项目源码 文件源码
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.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号