Esempio n. 1
0
    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)
Esempio n. 2
0
 def end_block(self, field, userdata=None):
     WriterTextStream.end_block(self, field, userdata)
     self.stream().write(str(")"))
Esempio n. 3
0
 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)
Esempio n. 4
0
 def end_block(self, field, userdata = None):
     WriterTextStream.end_block(self, field, userdata)
     self.stream().write(str(")"))