File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 6
6
import json
7
7
import re
8
8
import argparse
9
+ from datetime import datetime
9
10
from enum import Enum , auto
10
11
11
12
from loguru import logger as LOG
@@ -43,11 +44,25 @@ def fmt_json(data):
43
44
return json .dumps (json .loads (data ), indent = 2 )
44
45
45
46
47
+ def fmt_cose_recent_timestamp (data ):
48
+ s = data .decode ()
49
+ ts , _ = s .split (":" )
50
+ dt = datetime .fromtimestamp (int (ts ))
51
+ return f"[{ dt .isoformat ()} ] { s } "
52
+
53
+
46
54
# List of table name regex to key and value format functions (first match is used)
47
55
# Callers can specify additional rules (e.g. for application-specific
48
56
# public tables) which get looked up first.
49
57
default_format_rule = {"key" : fmt_raw , "value" : fmt_raw }
50
58
default_tables_format_rules = [
59
+ (
60
+ "^public:ccf\\ .gov\\ .cose_recent_proposals$" ,
61
+ {
62
+ "key" : fmt_cose_recent_timestamp ,
63
+ "value" : fmt_json ,
64
+ },
65
+ ),
51
66
(
52
67
"^public:ccf\\ .internal\\ ..*$" ,
53
68
{
You can’t perform that action at this time.
0 commit comments