binary \n will not longer cause problems
This commit is contained in:
parent
9d2b1aa942
commit
669893b397
|
@ -139,7 +139,7 @@ class MPIEspectral_result: # mimic py_post result object
|
||||||
def _keyedPackedArray(self,identifier,length = 3,type = 'd'):
|
def _keyedPackedArray(self,identifier,length = 3,type = 'd'):
|
||||||
match = {'d': 8,'i': 4}
|
match = {'d': 8,'i': 4}
|
||||||
self.file.seek(0)
|
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 = []
|
values = []
|
||||||
if m:
|
if m:
|
||||||
for i in m.groups():
|
for i in m.groups():
|
||||||
|
@ -149,7 +149,7 @@ class MPIEspectral_result: # mimic py_post result object
|
||||||
def _keyedInt(self,identifier):
|
def _keyedInt(self,identifier):
|
||||||
value = None
|
value = None
|
||||||
self.file.seek(0)
|
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:
|
if m:
|
||||||
value = struct.unpack('i',m.group(1))[0]
|
value = struct.unpack('i',m.group(1))[0]
|
||||||
return value
|
return value
|
||||||
|
@ -157,7 +157,7 @@ class MPIEspectral_result: # mimic py_post result object
|
||||||
def _keyedString(self,identifier):
|
def _keyedString(self,identifier):
|
||||||
value = None
|
value = None
|
||||||
self.file.seek(0)
|
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:
|
if m:
|
||||||
value = m.group(2)
|
value = m.group(2)
|
||||||
return value
|
return value
|
||||||
|
|
Loading…
Reference in New Issue