mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
scripts: Also print entry offset in shadacat.py
This commit is contained in:
parent
e2994a3c62
commit
38b8eb3561
@ -59,9 +59,10 @@ def mnormalize(o):
|
|||||||
|
|
||||||
|
|
||||||
with open(sys.argv[1], 'rb') as fp:
|
with open(sys.argv[1], 'rb') as fp:
|
||||||
unpacker = msgpack.Unpacker(file_like=fp)
|
unpacker = msgpack.Unpacker(file_like=fp, read_size=1)
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
pos = fp.tell()
|
||||||
typ = EntryTypes(unpacker.unpack())
|
typ = EntryTypes(unpacker.unpack())
|
||||||
except msgpack.OutOfData:
|
except msgpack.OutOfData:
|
||||||
break
|
break
|
||||||
@ -70,5 +71,5 @@ with open(sys.argv[1], 'rb') as fp:
|
|||||||
time = datetime.fromtimestamp(timestamp)
|
time = datetime.fromtimestamp(timestamp)
|
||||||
length = unpacker.unpack()
|
length = unpacker.unpack()
|
||||||
entry = unpacker.unpack()
|
entry = unpacker.unpack()
|
||||||
print('{0:13} {1} {2:5} {3!r}'.format(
|
print('{0:4} {1:13} {2} {3:5} {4!r}'.format(
|
||||||
typ.name, time.isoformat(), length, mnormalize(entry)))
|
pos, typ.name, time.isoformat(), length, mnormalize(entry)))
|
||||||
|
Loading…
Reference in New Issue
Block a user