Browse Source

print nice and sorted by time

PYADPT-55
Volker Birk 6 years ago
parent
commit
10b7533d0c
  1. 2
      test/sync_handshake.py
  2. 4
      test/sync_test.py

2
test/sync_handshake.py

@ -50,7 +50,7 @@ def print_msg(p):
with open(p, "r") as f:
t = f.read(-1)
msg = pEp.Message(t)
print("\n" + colored(str(p), color))
print("\n" + colored(p.name, color))
print(datetime.fromtimestamp(p.stat().st_mtime))
m = re.search("<payload>(.*)</payload>", msg.opt_fields["pEp.sync"])
print(m.group(1))

4
test/sync_test.py

@ -122,7 +122,9 @@ if __name__ == "__main__":
from sync_handshake import print_msg
inbox = pathlib.Path("TestInbox")
for p in reversed([ path for path in inbox.glob("*.eml") ]):
l = [ path for path in inbox.glob("*.eml") ]
l.sort(key=(lambda p: p.stat().st_mtime))
for p in l:
print_msg(p)
else:

Loading…
Cancel
Save