Add get_hide() to return the value of the "hide" tag

in field attributes.

svn path=/trunk/; revision=14379
This commit is contained in:
Gilbert Ramirez 2005-05-16 23:21:01 +00:00
parent dc82444047
commit d3cd8d93e8
1 changed files with 7 additions and 0 deletions

View File

@ -96,6 +96,7 @@ class ProtoTreeItem(PacketList):
self.size = xmlattrs.get("size", "")
self.value = xmlattrs.get("value", "")
self.show = xmlattrs.get("show", "")
self.hide = xmlattrs.get("hide", "")
def add_child(self, child):
self.children.append(child)
@ -118,6 +119,9 @@ class ProtoTreeItem(PacketList):
def get_show(self):
return self.show
def get_hide(self):
return self.hide
def dump(self, fh):
if self.name:
print >> fh, " name=%s" % (saxutils.quoteattr(self.name),),
@ -137,6 +141,9 @@ class ProtoTreeItem(PacketList):
if self.show:
print >> fh, "show=%s" % (saxutils.quoteattr(self.show),),
if self.hide:
print >> fh, "hide=%s" % (saxutils.quoteattr(self.hide),),
class Packet(ProtoTreeItem, PacketList):
def dump(self, fh, indent=0):
print >> fh, " " * indent, "<packet>"