blob: 61275abd8ac2d2f496d928c5485ad9e39ac0bf5d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/bin/env python3
import datetime
import getopt
import sys
opts, args = getopt.getopt(sys.argv[1:], '')
try:
now = datetime.datetime.now(datetime.UTC)
except AttributeError:
now = datetime.datetime.utcnow()
with open(args[0]) as f:
table = f.read()
with open(args[1]) as f:
table6 = f.read()
doc = sys.stdin.read()
doc = doc.replace('%LAST_UPDATE_ISOTIME%', now.isoformat())
doc = doc.replace('%THE_TABLE_V4%', table)
doc = doc.replace('%THE_TABLE_V6%', table6)
sys.stdout.write(doc)
|