equal
deleted
inserted
replaced
66 The header is followed by the markers. Marker format depend of the version. See |
66 The header is followed by the markers. Marker format depend of the version. See |
67 comment associated with each format for details. |
67 comment associated with each format for details. |
68 |
68 |
69 """ |
69 """ |
70 import struct |
70 import struct |
71 import util, base85, node |
71 import util, base85, node, parsers |
72 import phases |
72 import phases |
73 from i18n import _ |
73 from i18n import _ |
74 |
74 |
75 _pack = struct.pack |
75 _pack = struct.pack |
76 _unpack = struct.unpack |
76 _unpack = struct.unpack |
299 unpack = _unpack |
299 unpack = _unpack |
300 |
300 |
301 # Loop on markers |
301 # Loop on markers |
302 stop = len(data) - _fm1fsize |
302 stop = len(data) - _fm1fsize |
303 ufixed = util.unpacker(_fm1fixed) |
303 ufixed = util.unpacker(_fm1fixed) |
|
304 |
|
305 fast = getattr(parsers, 'fm1readmarker', None) |
|
306 if fast is not None: |
|
307 while off <= stop: |
|
308 ret = fast(data, off) |
|
309 yield ret[1:] |
|
310 off += ret[0] |
|
311 return |
|
312 |
304 while off <= stop: |
313 while off <= stop: |
305 # read fixed part |
314 # read fixed part |
306 o1 = off + fsize |
315 o1 = off + fsize |
307 t, secs, tz, flags, numsuc, numpar, nummeta, prec = ufixed(data[off:o1]) |
316 t, secs, tz, flags, numsuc, numpar, nummeta, prec = ufixed(data[off:o1]) |
308 |
317 |