android_handset.py 文件源码

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

项目:ave 作者: sonyxperiadev 项目源码 文件源码
def once(self):
        # check if there is a request to get and clear accumulated logs
        msg = self._recv(timeout=0)
        if msg == 'get':
             self._send(self.log_buf.getvalue())
             self.log_buf = StringIO()

        # is there new logcat output to read?
        if not self.poller.poll(500): # millisecond timeout
            return

        # read logcat output and store it in a buffer, optionally to file too
        log = os.read(self.cmd_fd, 1000)
        if self.log_file:
            self.log_file.write(log)
            self.log_file.flush()
        if self.log_buf.tell() > LOGBUF_MAXSIZE:
            self.log_buf = StringIO() # start over to avoid OOM
        self.log_buf.write(log)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号