Changeset 2341
- Timestamp:
- Jun 23, 2016 9:25:06 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r2304 r2341 555 555 else: 556 556 if singlereader: 557 print('The '+ rd.formatName+ 558 ' reader was not able to read file '+filename+msg) 559 try: 560 print('\n\nError message(s):\n\t'+errorReport) 561 except: 562 pass 557 563 self.ErrorDialog('Read Error','The '+ rd.formatName+ 558 ' reader was not able to read file '+filename+msg+ 559 '\n\nError message(s):\n'+errorReport 560 ) 564 ' reader was not able to read file '+filename+msg) 561 565 else: 562 self.ErrorDialog('Read Error','No reader was able to read file '+filename+msg+ 563 '\n\nError messages:\n'+errorReport 564 ) 566 print('No reader was able to read file '+filename+msg) 567 try: 568 print('\n\nError message(s):\n\t'+errorReport) 569 except: 570 pass 571 self.ErrorDialog('Read Error','No reader was able to read file '+filename+msg) 565 572 if fp: fp.close() 566 573 return rd_list … … 1459 1466 dlg.Destroy() 1460 1467 HistName = G2obj.MakeUniqueLabel(HistName,PWDRlist) 1461 print 'Read powder data '+str(HistName)+ \ 1462 ' from file '+str(rd.readfilename) + \ 1463 ' with parameters from '+str(rd.instmsg) 1468 print('Read powder data '+str(HistName)+ 1469 ' from file '+str(rd.readfilename) + 1470 ' (format: '+ rd.formatName + 1471 '). Inst parameters from '+str(rd.instmsg)) 1464 1472 # data are read, now store them in the tree 1465 1473 Id = self.PatternTree.AppendItem(parent=self.root,text=HistName) … … 1547 1555 phaseNameList = usedHistograms.keys() # phase names in use 1548 1556 if not phaseNameList: return # no phases yet, nothing to do 1549 header = 'Select phase(s) to add the new\npowder dataset(s) to:'1557 header = 'Select phase(s) to link\nto new data:' 1550 1558 for Name in newHistList: 1551 1559 header += '\n '+str(Name) -
trunk/GSASIIIO.py
r2298 r2341 1428 1428 else: # found something invalid 1429 1429 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.' 1433 1436 return False 1434 1437 -
trunk/imports/G2pwd_BrukerRAW.py
r2238 r2341 44 44 self.formatName = 'Bruker RAW ver. 3' 45 45 else: 46 self.errors = 'Unexpected information in header: '+str(head) 47 self.errors += ' '+str(head) 46 self.errors = 'Unexpected information in header: ' 47 if all([ord(c) < 128 and ord(c) != 0 for c in str(head)]): # show only if ASCII 48 self.errors += ' '+str(head) 49 else: 50 self.errors += ' (binary)' 48 51 return False 49 52 return True -
trunk/imports/G2pwd_FP.py
r2161 r2341 60 60 except ValueError: 61 61 self.errors = 'Unexpected information in line: '+str(i+1) 62 self.errors += ' '+str(S) 62 if all([ord(c) < 128 and ord(c) != 0 for c in str(S)]): # show only if ASCII 63 self.errors += ' '+str(S) 64 else: 65 self.errors += ' (binary)' 63 66 return False 64 67 return True # no errors encountered -
trunk/imports/G2pwd_Pnn.py
r2285 r2341 16 16 17 17 import sys 18 import os.path as ospath18 import os.path 19 19 import numpy as np 20 20 import array as ar … … 26 26 def __init__(self): 27 27 super(self.__class__,self).__init__( # fancy way to self-reference 28 extensionlist=('.P*',), 28 extensionlist=('.P01','.P02','.P03','.P04','.P05','.P06', 29 '.P07','.P08','.P09','.P*',), 29 30 strictExtension=False, 30 formatName = 'GSAS Pnn',31 longFormatName = 'GSAS Pnn powder data file'31 formatName = 'GSAS .Pnn', 32 longFormatName = 'GSAS .Pnn powder data file' 32 33 ) 33 34 … … 37 38 gotCcomment = False 38 39 self.GSAS = False 39 return True # no errors encountered 40 # file extension must be .Pxx or .pxx 41 ext = os.path.splitext(filepointer.name)[1] 42 if ext[1].upper() != 'P' or len(ext) != 4: 43 return False 44 if ext[2].isdigit() and ext[3].isdigit(): 45 return True # no errors encountered 46 return False 47 40 48 41 49 def Reader(self,filename,filepointer, ParentFrame=None, **unused): … … 64 72 self.powderentry[0] = filename 65 73 self.powderentry[2] = 1 # Pnn file only has one bank 66 self.idstring = os path.basename(filename)74 self.idstring = os.path.basename(filename) 67 75 return True 68 76 -
trunk/imports/G2pwd_fxye.py
r2152 r2341 52 52 else: 53 53 self.errors = 'Unexpected information in line: '+str(i+1) 54 self.errors += ' '+str(line) 54 if all([ord(c) < 128 and ord(c) != 0 for c in str(line)]): # show only if ASCII 55 self.errors += ' '+str(line) 56 else: 57 self.errors += ' (binary)' 55 58 return False 56 59 return False # no bank records -
trunk/imports/G2pwd_xye.py
r1620 r2341 56 56 else: 57 57 self.errors = 'Unexpected information in line: '+str(i+1) 58 self.errors += ' '+str(S) 58 if all([ord(c) < 128 and ord(c) != 0 for c in str(S)]): # show only if ASCII 59 self.errors += ' '+str(S) 60 else: 61 self.errors += ' (binary)' 59 62 return False 60 63 return True # no errors encountered
Note: See TracChangeset
for help on using the changeset viewer.