Changeset 2542


Ignore:
Timestamp:
Nov 21, 2016 1:52:48 PM (5 years ago)
Author:
toby
Message:

deal a bit better with Unicode file names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r2539 r2542  
    308308                                readerlist.append(reader)
    309309            except AttributeError:
    310                 print 'Import_'+errprefix+': Attribute Error '+str(filename)
     310                print 'Import_'+errprefix+': Attribute Error '+ filename
    311311            #except ImportError:
    312             #    print 'Import_'+errprefix+': Error importing file '+str(filename)
     312            #    print 'Import_'+errprefix+': Error importing file '+ filename
    313313            except Exception,errmsg:
    314                 print('\nImport_'+errprefix+': Error importing file '+str(filename))
     314                print('\nImport_'+errprefix+': Error importing file '+ filename)
    315315                print('Error message: '+str(errmsg)+'\n')
    316316            if fp: fp.close()
     
    328328    def PreviewFile(self,filename,fp):
    329329        'confirm we have the right file'
    330         rdmsg = 'File '+repr(filename)+' begins:\n\n'
     330        rdmsg = 'File '+ filename +' begins:\n\n'
    331331        for i in range(3):
    332332            rdmsg += fp.readline()
    333333        rdmsg += '\n\nDo you want to read this file?'
    334334        if not all([ord(c) < 128 and ord(c) != 0 for c in rdmsg]): # show only if ASCII
    335             rdmsg = 'File '+str(
    336                 filename)+' is a binary file. Do you want to read this file?'
     335            rdmsg = 'File '+ filename +' is a binary file. Do you want to read this file?'
    337336        # it would be better to use something that
    338337        # would resize better, but this will do for now
Note: See TracChangeset for help on using the changeset viewer.