(self,buf)
return
Fill self from binary string.
Fill self from binary string.
Fill self from binary string .
def decode(self,buf):
        'Fill self from binary string.'
        import struct

        index = 0

        for field in DBHDR.format:
            name,nbytes,typecode = field
            string = buf[index:index+nbytes]
            index += nbytes
            value = struct.unpack('<'+typecode, string)[0]
            self.__dict__[name] = value
            continue

        if DBHDR.signatures[0] != self.signature1 or \
                DBHDR.signatures[1] != self.signature2:
            msg = 'Bad sigs:\n%s %s\n%s %s'%\
                (DBHDR.signatures[0],DBHDR.signatures[1],
                 self.signature1,self.signature2)
            raise IOError,msg

        return
def decode ( self , buf ) : import struct index = 0 for field in DBHDR . format : name , nbytes , typecode = field string = buf [ index : index + nbytes ] index += nbytes value = struct . unpack ( '<' + typecode , string ) [ 0 ] self . __dict__ [ name ] = value continue if DBHDR . signatures [ 0 ] != self . signature1 or DBHDR . signatures [ 1 ] != self . signature2 : msg = 'Bad sigs:\n%s %s\n%s %s' % ( DBHDR . signatures [ 0 ] , DBHDR . signatures [ 1 ] , self . signature1 , self . signature2 ) raise IOError , msg return