-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
webui: ntp offsets from tzdata/etcetera
refer to our docs for the script output see #2548
- Loading branch information
Showing
22 changed files
with
11,966 additions
and
11,815 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
2,837 changes: 1,422 additions & 1,415 deletions
2,837
code/espurna/static/index.thermostat.html.gz.h
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import argparse | ||
import mmap | ||
import os | ||
import pytz | ||
import sys | ||
|
||
def zones(root): | ||
out = [] | ||
|
||
for zone in pytz.all_timezones_set: | ||
with open(os.path.join(root, zone), "rb") as f: | ||
magic = f.read(4) | ||
if magic != b"TZif": | ||
continue | ||
|
||
m = mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ) | ||
newline = m.rfind(b'\n', 0, len(m) - 1) | ||
if newline < 0: | ||
continue | ||
|
||
m.seek(newline + 1) | ||
tz = m.readline().strip() | ||
|
||
out.append([zone, tz.decode("ascii")]) | ||
|
||
out.sort(key=lambda x: x[0]) | ||
return out | ||
|
||
def table(zones): | ||
print("|Name|Value|") | ||
print("|---|---|") | ||
for name, value in zones: | ||
print(f"|{name}|{value}|") | ||
|
||
print() | ||
print(f"*{pytz.OLSON_VERSION=}*") | ||
print(f"*{pytz.VERSION=}*") | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--root", | ||
help="Where do we get raw zoneinfo files from", | ||
default=os.path.join(os.path.dirname(pytz.__file__), "zoneinfo")) | ||
args = parser.parse_args() | ||
|
||
table(zones(args.root)) |