forked from uniborg/uniborg
truncate really long byte sequences
This commit is contained in:
parent
192e1d890a
commit
225e377130
|
@ -63,7 +63,10 @@ def yaml_format(obj, indent=0):
|
||||||
if all(c in PRINTABLE_SET for c in obj):
|
if all(c in PRINTABLE_SET for c in obj):
|
||||||
result.append(repr(obj))
|
result.append(repr(obj))
|
||||||
else:
|
else:
|
||||||
result.append(' '.join(f'{b:02X}' for b in obj))
|
if len(obj) > 64:
|
||||||
|
result.append('<…>')
|
||||||
|
else:
|
||||||
|
result.append(' '.join(f'{b:02X}' for b in obj))
|
||||||
elif isinstance(obj, datetime.datetime):
|
elif isinstance(obj, datetime.datetime):
|
||||||
# ISO-8601 without timezone offset (telethon dates are always UTC)
|
# ISO-8601 without timezone offset (telethon dates are always UTC)
|
||||||
result.append(obj.strftime('%Y-%m-%d %H:%M:%S'))
|
result.append(obj.strftime('%Y-%m-%d %H:%M:%S'))
|
||||||
|
|
Loading…
Reference in New Issue