otFeatures.py 文件源码

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

项目:inter 作者: rsms 项目源码 文件源码
def write(self, group=0):
        """Write the whole thing to string"""
        t = []
        if len(self.data) == 0:
            return None
        t.append('feature %s {' % self.type)
        for src, dst in self.data:
            if isinstance(src, (list, tuple)):
                if group:
                    src = "[%s]" % string.join(src, ' ')
                else:
                    src = string.join(src, ' ')
            if isinstance(dst, (list, tuple)):
                if group:
                    dst = "[%s]" % string.join(dst, ' ')
                else:
                    dst = string.join(dst, ' ')
            src = string.strip(src)
            dst = string.strip(dst)
            t.append("\tsub %s by %s;" % (src, dst))
        t.append('}%s;' % self.type)
        return string.join(t, '\n')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号