def asRawData(self): '''system: encode and answer decode dbf field definition as 32-byte raw dbf data jjk 02/19/98''' rdl = [strutil.padTrailing(self.name, 11, chr(0)), self.typeCode(), binnum.unsigned_as_Intel4(0), #data address chr(self.length), chr(self.decimalCount), 14*chr(0)] return(string.joinfields(rdl,''))
def encodeValue(self, fieldValue): '''system: answer raw data string encoded from a field value jjk 02/19/98''' rv = str(fieldValue)[:self.length] return(strutil.padTrailing(rv, self.length))