add a function to get the timestamp of the last provider-db update

This commit is contained in:
B. Petersen
2020-09-10 18:30:10 +02:00
parent f8d7242079
commit 277bbfaead
3 changed files with 31 additions and 2 deletions

View File

@@ -4,6 +4,7 @@
import sys
import os
import yaml
import datetime
out_all = ""
out_domains = ""
@@ -169,6 +170,12 @@ if __name__ == "__main__":
out_all += " pub static ref PROVIDER_DATA: HashMap<&'static str, &'static Provider> = [\n"
out_all += out_domains;
out_all += " ].iter().copied().collect();\n}"
out_all += " ].iter().copied().collect();\n\n"
now = datetime.datetime.utcnow()
out_all += " pub static ref PROVIDER_UPDATED: chrono::NaiveDate = "\
"chrono::NaiveDate::from_ymd("+str(now.year)+", "+str(now.month)+", "+str(now.day)+");\n"
out_all += "}"
print(out_all)