binary \n will not longer cause problems

This commit is contained in:
Martin Diehl 2011-02-01 18:25:40 +00:00
parent 9d2b1aa942
commit 669893b397
1 changed files with 134 additions and 134 deletions

View File

@ -139,7 +139,7 @@ class MPIEspectral_result: # mimic py_post result object
def _keyedPackedArray(self,identifier,length = 3,type = 'd'):
match = {'d': 8,'i': 4}
self.file.seek(0)
m = re.search('%s%s'%(identifier,'(.{%i})'%(match[type])*length),self.file.read(2048))
m = re.search('%s%s'%(identifier,'(.{%i})'%(match[type])*length),self.file.read(2048),re.DOTALL)
values = []
if m:
for i in m.groups():
@ -149,7 +149,7 @@ class MPIEspectral_result: # mimic py_post result object
def _keyedInt(self,identifier):
value = None
self.file.seek(0)
m = re.search('%s%s'%(identifier,'(.{4})'),self.file.read(2048))
m = re.search('%s%s'%(identifier,'(.{4})'),self.file.read(2048),re.DOTALL)
if m:
value = struct.unpack('i',m.group(1))[0]
return value
@ -157,7 +157,7 @@ class MPIEspectral_result: # mimic py_post result object
def _keyedString(self,identifier):
value = None
self.file.seek(0)
m = re.search(r'(.{4})%s(.*?)\1'%identifier,self.file.read(2048))
m = re.search(r'(.{4})%s(.*?)\1'%identifier,self.file.read(2048),re.DOTALL)
if m:
value = m.group(2)
return value