def __field_line(self, field, userdata):
        s = str('<field name="%s" class="%s" size="%d">') \
            % (field.name(), field.__class__.__name__, field.size())
        self.stream().write(s)
        self.stream().write(self.config().newline)

        WriterTextStream.start_block(self, field, userdata)
        self.indent()
        self.stream().write(
            str("<hex_value>%s</hex_value>") % field.str_hex_value())
        self.stream().write(self.config().newline)

        self.indent()
        self.stream().write(str("<value>%s</value>") % field.str_value())
        self.stream().write(self.config().newline)

        self.indent()
        self.stream().write(
            str("<eng_value>%s</eng_value>") % field.str_eng_value())
        self.stream().write(self.config().newline)
        WriterTextStream.end_block(self, field, userdata)

        self.indent()
        self.stream().write(str("</field>"))
        if self.level() > 0:
            self.stream().write(self.config().newline)
Exemple #2
0
 def start_block(self, field, userdata=None):
     WriterTextStream.start_block(self, field, userdata)
     try:
         str_hex = " " + field.str_hex_value()
     except:
         str_hex = ""
     self.stream().write(str("(%s =%s") % (field.name(), str_hex))
 def start_block(self, field, userdata = None):
     WriterTextStream.start_block(self, field, userdata)
     try:
         str_hex = " " + field.str_hex_value()
     except:
         str_hex = ""
     self.stream().write(str("(%s =%s") % (field.name(), str_hex))
 def start_block(self, field, userdata=None):
     WriterTextStream.start_block(self, field, userdata)
     try:
         s = str('<container name="%s" class="%s" size="%d" value="%s">') \
             % (field.name(), field.__class__.__name__, field.size(),
                field.str_hex_value())
     except:
         s = str('<container name="%s" class="%s" size="%d">') \
             % (field.name(), field.__class__.__name__, field.size())
     self.stream().write(s)
     self.stream().write(self.config().newline)
Exemple #5
0
 def end_block(self, field, userdata=None):
     WriterTextStream.end_block(self, field, userdata)
     self.stream().write(str(")"))
 def end_block(self, field, userdata=None):
     WriterTextStream.end_block(self, field, userdata)
     self.indent()
     self.stream().write(str("</container>"))
     if self.level() > 0:
         self.stream().write(self.config().newline)
Exemple #7
0
 def __init__(self, stream, config = WriterTextTableConfig()):
     WriterTextStream.__init__(self, stream, config)
 def end_block(self, field, userdata = None):
     WriterTextStream.end_block(self, field, userdata)
     self.stream().write(str(")"))