__init__.py 文件源码

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

项目:core-framework 作者: RedhawkSDR 项目源码 文件源码
def api(self, destfile=None):
        localdef_dest = False
        if destfile == None:
            localdef_dest = True
            destfile = cStringIO.StringIO()

        print >>destfile, 'Allocation Properties ======'
        if not self._allocProps:
            print >>destfile, 'None'
            return

        table = TablePrinter('Property Name', '(Data Type)', 'Action')
        for prop in self._allocProps:
            table.append(prop.clean_name, '('+prop.type+')', prop.action)
            if prop.type in ('struct', 'structSeq'):
                if prop.type == 'structSeq':
                    structdef = prop.structDef
                else:
                    structdef = prop
                for member in structdef.members.itervalues():
                    table.append('  '+member.clean_name, member.type)
        table.write(f=destfile)
        if localdef_dest:
            pydoc.pager(destfile.getvalue())
            destfile.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号