Ignore:
Timestamp:
Mar 3, 2017 11:03:36 AM (7 years ago)
Author:
toby
Message:

more unicode fixes, fix shelx END problem

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/imports/G2phase_INS.py

    r2470 r2736  
    4949    def Reader(self,filename,filepointer, ParentFrame=None, **unused):
    5050        'Read a ins file using :meth:`ReadINSPhase`'
    51         try:
    52             self.Phase = self.ReadINSPhase(filename, ParentFrame)
    53             return True
    54         except Exception as detail:
    55             self.errors += '\n  '+str(detail)
    56             print 'INS read error:',detail # for testing
    57             traceback.print_exc(file=sys.stdout)
    58             return False
     51        #try:
     52        self.Phase = self.ReadINSPhase(filename, ParentFrame)
     53        return True
     54        #except Exception as detail:
     55        #    self.errors += '\n  '+str(detail)
     56        #    print 'INS read error:',detail # for testing
     57        #    traceback.print_exc(file=sys.stdout)
     58        #    return False
    5959
    6060    def ReadINSPhase(self,filename,parent=None):
     
    6262        '''
    6363        Shelx = ['TITL','CELL','ZERR','LATT','SYMM','SFAC','DISP','UNIT','LAUE','EADP',
    64             'MORE','TIME','END ','HKLF','OMIT','SHEL','BASF','TWIN','EXTI','SWAT',
     64            'MORE','TIME','HKLF','OMIT','SHEL','BASF','TWIN','EXTI','SWAT',
    6565            'HOPE','MERG','SPEC','RESI','RTAB','MPLA','HFIX','MOVE','ANIS','AFIX',
    6666            'FRAG','FEND','EXYZ','EDAP','EQIV','CONN','PART','BIND','FREE','DFIX','DANG',
     
    116116            elif S[:3].upper() == 'REM':
    117117                pass
    118             elif S[:4].upper() not in Shelx:   #this will find an atom record!
     118            elif S[:3].upper() == 'END':
     119                pass
     120            elif S[:4].strip().upper() not in Shelx:   #this will find an atom record!
    119121                AtRec = S.split()
    120122                Atype = aTypes[int(AtRec[1])-1]
Note: See TracChangeset for help on using the changeset viewer.