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()
评论列表
文章目录