read.py 文件源码

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

项目:farnsworth 作者: mechaphish 项目源码 文件源码
def to_xml(self):
        read = Element('read')

        if self.echo is not None:
            read.set('echo', self.echo)

        if self.length is not None:
            length = Element('length')
            length.text = str(self.length)
            read.append(length)

        for thing in ('delim', 'match', 'assign'):
            if getattr(self, thing) is not None:
                read.append(getattr(self, thing).to_xml())

        if self.timeout is not None:
            timeout = Element('timeout')
            timeout.text = str(self.timeout)
            read.append(timeout)

        return read
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号