Changeset 4184 for trunk/GSASIIIO.py


Ignore:
Timestamp:
Oct 21, 2019 12:02:18 PM (2 years ago)
Author:
toby
Message:

fix GPX files with a colour object in them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r4119 r4184  
    582582    if type(data) is list or type(data) is tuple:
    583583        for i in range(len(data)):
    584             objectScan(data[i],tag,indexStack+[i])
     584            val = objectScan(data[i],tag,indexStack+[i])
     585            if val:
     586                data[i] = val
     587                print('...fixed')
    585588    elif type(data) is dict:
    586589        for key in data:
    587             objectScan(data[key],tag,indexStack+[key])
     590            val = objectScan(data[key],tag,indexStack+[key])
     591            if val:
     592                data[key] = val
     593                print('...fixed')
    588594    elif data is None:
    589         return
     595        return None
    590596    elif type(data) in objectScanIgnore:
    591         return
     597        return None
    592598    else:
    593599        s = 'unexpected object in '+tag
     
    598604        global unexpectedObject
    599605        unexpectedObject = True
     606        # fix bad objects
     607        if "gdi.Colour" in str(type(data)):
     608            return tuple(data)
     609        return
    600610   
    601611def cPickleLoad(fp):
Note: See TracChangeset for help on using the changeset viewer.