Skip to content

Commit 73ae6cb

Browse files
committed
shorter transient message
1 parent 3b5bc1d commit 73ae6cb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/runall.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import itertools
66
import logging
77
import os
8+
import re
89
import shutil
910
import sqlite3
1011
import subprocess
@@ -107,6 +108,11 @@ def save_cache():
107108
# print(f"{FEINT}{ITALIC}cache commited{RESET}")
108109

109110

111+
def shorten_key(key: str) -> str:
112+
key = re.sub(r":([a-f\d]{9}[a-f\d]+):", lambda m: f":{m[1][:8]}…:", key)
113+
return key
114+
115+
110116
def check_cache(key, file_timestamp: Path, table: str, columns: t.Iterable[str], no_age_check=False):
111117
cache = get_cache()
112118
key = str(key)
@@ -124,10 +130,10 @@ def check_cache(key, file_timestamp: Path, table: str, columns: t.Iterable[str],
124130
# delta = timedelta(seconds=seconds)
125131
# print(f"{FEINT}{ITALIC}entry {key} is out of date for {delta}{RESET}", end=f"{CR}")
126132

127-
print(f"{FEINT}{ITALIC}entry {key} is out of date{RESET}", end=TRANSIENT)
133+
print(f"{FEINT}{ITALIC}entry {shorten_key(key)} is out of date{RESET}", end=TRANSIENT)
128134

129135
else:
130-
print(f"{FEINT}{ITALIC}missing cache for {key}{RESET}", end=TRANSIENT)
136+
print(f"{FEINT}{ITALIC}missing cache for {shorten_key(key)}{RESET}", end=TRANSIENT)
131137

132138

133139
def update_cache(key, timestamp: Path, table: str, row: t.Dict[str, t.Union[str, int]]) -> None:

0 commit comments

Comments
 (0)