Changeset 2341 for trunk/GSASIIIO.py


Ignore:
Timestamp:
Jun 23, 2016 9:25:06 PM (7 years ago)
Author:
toby
Message:

improve powder imports: suppress printing of binary data; improve validation of old GSAS binary files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r2298 r2341  
    14281428            else: # found something invalid
    14291429                self.errors = 'line '+str(i+1)+' contains unexpected data:\n'
    1430                 self.errors += '  '+str(l)
    1431                 self.errors += '  Note: a CIF should only have blank lines or comments before'
    1432                 self.errors += '        a data_ statement begins a block.'
     1430                if all([ord(c) < 128 and ord(c) != 0 for c in str(l)]): # show only if ASCII
     1431                    self.errors += '  '+str(l)
     1432                else:
     1433                    self.errors += '  (binary)'
     1434                self.errors += '\n  Note: a CIF should only have blank lines or comments before'
     1435                self.errors += '\n        a data_ statement begins a block.'
    14331436                return False
    14341437
Note: See TracChangeset for help on using the changeset viewer.