crumbs.py
def process(self, bindata):
        """Given the binary data for an entry, generate its formatted string representation
        and return the string to caller.  The format string for the entry in the crumb
        definition file will have "%{name}" sections.  This function replaces it with the
        data from the field with the same name.  The formatting options are the same as those
        in python.  If the formatting option is omitted, a default in (%d) is used or the
        enumeration name if the field was specified as a list of named values.
        """


        data = struct.unpack(self.packfmt, bindata)

        output = ''

        if 'timestamp' in self.fieldbyname:
            output += '[%012f] ' % (self.getdata('timestamp', data) * TIMESCALE)

        output += '%s-%s: ' % (self.cat['name'], self.name)

        # This is basically a highly-simplified "printf" that lives within the restrictions
        # of the allowable types of a crumb file (i.e., built-in C types or an enumerated
        # field.
        i = 0
        while i < len(self.format):
            c = self.format[i]

            if c == '%':
                v = c
                i += 1
                c = self.format[i]
                while c != '{':
                    v += c
                    i += 1
                    c = self.format[i]

                name = ''
                i += 1
                c = self.format[i]
                while c != '}':
                    name += c
                    i += 1
                    c = self.format[i]

                i += 1

                f = self.fieldbyname[name]

                # Default formatting...
                if v == '%':
                    # Need to check if this is a numeric or enumerated type...
                    if f[F_RAW] in BUILTIN_CTYPES:
                        output += '%d' % data[f[F_POS]]
                    else:
                        output += '%s' % f[F_RAW].split(' ')[data[f[F_POS]]]
                else:
                    output += v % data[f[F_POS]]

            else:
                output += c
                i += 1

        return output
Given the binary data for an entry, generate its formatted string representation
        and return the string to caller.  The format string for the entry in the crumb
        definition file will have "%{name}" sections.  This function replaces it with the
        data from the field with the same name.  The formatting options are the same as those
        in python.  If the formatting option is omitted, a default in (%d) is used or the
        enumeration name if the field was specified as a list of named values.
        
Given the binary data for an entry, generate its formatted string representation
and return the string to caller.  The format string for the entry in the crumb
definition file will have "%{name}" sections.  This function replaces it with the
data from the field with the same name.  The formatting options are the same as those
in python.  If the formatting option is omitted, a default in (%d) is used or the
enumeration name if the field was specified as a list of named values.
Given the binary data for an entry generate its formatted string representation and return the string to caller . The format string for the entry in the crumb definition file will have " % { name } " sections . This function replaces it with the data from the field with the same name . The formatting options are the same as those in python . If the formatting option is omitted a default in ( %d ) is used or the enumeration name if the field was specified as a list of named values .
def process(self, bindata):
        data = struct.unpack(self.packfmt, bindata)
        output = ''
        if 'timestamp' in self.fieldbyname:
            output += '[%012f] ' % (self.getdata('timestamp', data) * TIMESCALE)
        output += '%s-%s: ' % (self.cat['name'], self.name)
        i = 0
        while i < len(self.format):
            c = self.format[i]
            if c == '%':
                v = c
                i += 1
                c = self.format[i]
                while c != '{':
                    v += c
                    i += 1
                    c = self.format[i]
                name = ''
                i += 1
                c = self.format[i]
                while c != '}':
                    name += c
                    i += 1
                    c = self.format[i]
                i += 1
                f = self.fieldbyname[name]
                if v == '%':
                    if f[F_RAW] in BUILTIN_CTYPES:
                        output += '%d' % data[f[F_POS]]
                    else:
                        output += '%s' % f[F_RAW].split(' ')[data[f[F_POS]]]
                else:
                    output += v % data[f[F_POS]]
            else:
                output += c
                i += 1
        return output
def process ( self , bindata ) : data = struct . unpack ( self . packfmt , bindata ) output = '' if 'timestamp' in self . fieldbyname : output += '[%012f] ' % ( self . getdata ( 'timestamp' , data ) * TIMESCALE ) output += '%s-%s: ' % ( self . cat [ 'name' ] , self . name ) i = 0 while i < len ( self . format ) : c = self . format [ i ] if c == '%' : v = c i += 1 c = self . format [ i ] while c != '{' : v += c i += 1 c = self . format [ i ] name = '' i += 1 c = self . format [ i ] while c != '}' : name += c i += 1 c = self . format [ i ] i += 1 f = self . fieldbyname [ name ] if v == '%' : if f [ F_RAW ] in BUILTIN_CTYPES : output += '%d' % data [ f [ F_POS ] ] else : output += '%s' % f [ F_RAW ] . split ( ' ' ) [ data [ f [ F_POS ] ] ] else : output += v % data [ f [ F_POS ] ] else : output += c i += 1 return output
Given the binary data for an entry, generate its formatted string representation
and return the string to caller.
Given the binary data for an entry generate its formatted string representation and return the string to caller .
"""Given the binary data for an entry, generate its formatted string representation
        and return the string to caller.  The format string for the entry in the crumb
        definition file will have "%{name}" sections.  This function replaces it with the
        data from the field with the same name.  The formatting options are the same as those
        in python.  If the formatting option is omitted, a default in (%d) is used or the
        enumeration name if the field was specified as a list of named values.
        """ # This is basically a highly-simplified "printf" that lives within the restrictions # of the allowable types of a crumb file (i.e., built-in C types or an enumerated # field. # Default formatting... # Need to check if this is a numeric or enumerated type...
self
bindata