Changeset 2736
- Timestamp:
- Mar 3, 2017 11:03:36 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r2735 r2736 329 329 except Exception,errmsg: 330 330 print('\nImport_'+errprefix+': Error importing file '+ filename) 331 print( 'Error message: '+str(errmsg)+'\n')331 print(u'Error message: {}\n'.format(errmsg)) 332 332 if fp: fp.close() 333 333 … … 652 652 PhaseName = rd.Phase['General']['Name'][:] 653 653 newPhaseList.append(PhaseName) 654 print 'Read phase '+str(PhaseName)+' from file '+str(self.lastimport)654 print(u'Read phase {} from file {}'.format(PhaseName,self.lastimport)) 655 655 if not G2gd.GetPatternTreeItemId(self,self.root,'Phases'): 656 656 sub = self.PatternTree.AppendItem(parent=self.root,text='Phases') … … 1098 1098 Iparm[S[:12]] = S[12:-1] 1099 1099 except IOError: 1100 print( 'Error reading file:'+str(instfile))1100 print(u'Error reading file: {}'.format(instfile)) 1101 1101 if fp: 1102 1102 fp.close() … … 1424 1424 return GetDefaultParms(self,rd) 1425 1425 else: 1426 self.ErrorDialog('Open Error','Error opening instrument parameter file ' 1427 +str(instfile)+' requested by file '+ filename) 1426 self.ErrorDialog('Open Error', 1427 u'Error opening instrument parameter file ' 1428 +'{} requested by file '.format(instfile,filename)) 1428 1429 #Finally - ask user for Instrument parametrs file - seems it can't be in a zip file 1429 1430 while True: # loop until we get a file that works or we get a cancel … … 1464 1465 else: 1465 1466 self.ErrorDialog('Read Error', 1466 'Error opening/reading file '+str(instfile))1467 u'Error opening/reading file {}'.format(instfile)) 1467 1468 def EnableRefineCommand(self): 1468 1469 haveData = False … … 1595 1596 print('done') 1596 1597 except Exception as err: 1597 print( 'error: '+str(err))1598 print(u'error: {}'.format(err)) 1598 1599 print('with commands -------------------') 1599 print( str(corr))1600 print(corr) 1600 1601 print('---------------------------------') 1601 1602 finally: … … 1817 1818 self.PatternTree.Expand(Id) 1818 1819 self.PatternTree.SelectItem(Id) 1819 print( 'Added simulation powder data '+HistName+1820 ' with parameters from '+str(rd.instmsg))1820 print(u'Added simulation powder data {}'++ 1821 ' with parameters from {}'.format(HistName,rd.instmsg)) 1821 1822 1822 1823 # make a list of phase names … … 3810 3811 if 'pId' not in Phases[phase]: 3811 3812 self.ErrorDialog('View parameter error','You must run least squares at least once') 3812 raise Exception,'No pId for phase '+ str(phase)3813 raise Exception,'No pId for phase '+phase 3813 3814 rigidbodyDict = self.PatternTree.GetItemPyData( 3814 3815 G2gd.GetPatternTreeItemId(self,self.root,'Rigid bodies')) -
trunk/imports/G2phase_INS.py
r2470 r2736 49 49 def Reader(self,filename,filepointer, ParentFrame=None, **unused): 50 50 'Read a ins file using :meth:`ReadINSPhase`' 51 try:52 53 54 except Exception as detail:55 self.errors += '\n '+str(detail)56 print 'INS read error:',detail # for testing57 traceback.print_exc(file=sys.stdout)58 return False51 #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 59 59 60 60 def ReadINSPhase(self,filename,parent=None): … … 62 62 ''' 63 63 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', 65 65 'HOPE','MERG','SPEC','RESI','RTAB','MPLA','HFIX','MOVE','ANIS','AFIX', 66 66 'FRAG','FEND','EXYZ','EDAP','EQIV','CONN','PART','BIND','FREE','DFIX','DANG', … … 116 116 elif S[:3].upper() == 'REM': 117 117 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! 119 121 AtRec = S.split() 120 122 Atype = aTypes[int(AtRec[1])-1]
Note: See TracChangeset
for help on using the changeset viewer.