Changeset 20890


Ignore:
Timestamp:
07/13/16 10:19:51 (9 years ago)
Author:
Mathieu Morlighem
Message:

BUG: fixed BinRead with new marshall files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/scripts/BinRead.py

    r20219 r20890  
    1818        while True:
    1919                try:
    20                         #Step 1: read the enum to identify this record uniquely
    21                         enum=struct.unpack('i',f.read(struct.calcsize('i')))[0]
     20                        #Step 1: read size of record name
     21                        recordnamesize=struct.unpack('i',f.read(struct.calcsize('i')))[0]
    2222                except struct.error as e:
    2323                        print "probable EOF: %s" % e
    2424                        break
    25                 print "\nenum = %d (%s)" % (enum,EnumToString(enum)[0])
     25                print "\nrecordnamesize = \"%d\"" % (recordnamesize)
     26                recordname=struct.unpack('%ds' % recordnamesize,f.read(recordnamesize))[0]
     27                print "recordname = '%s'" % recordname
    2628
    2729                #Step 2: read the data itself.
     
    110112
    111113                else:
    112                         raise TypeError('BinRead error message: data type: %d not supported yet! (%s)' % (code,EnumToString(enum)[0]))
     114                        raise TypeError('BinRead error message: data type: %d not supported yet! (%s)' % (code,recordname))
    113115
    114116        f.close()
     
    163165
    164166        from MatlabFuncs import *
    165         from EnumDefinitions import *
    166         from EnumToString import EnumToString
    167167
    168168        BinRead(args.filin, args.filout)
Note: See TracChangeset for help on using the changeset viewer.