Files
zulip/tools/setup/build_timezone_values
Anders Kaseorg c1675913a2 web: Move web app to ‘web’ directory.
Ever since we started bundling the app with webpack, there’s been less
and less overlap between our ‘static’ directory (files belonging to
the frontend app) and Django’s interpretation of the ‘static’
directory (files served directly to the web).

Split the app out to its own ‘web’ directory outside of ‘static’, and
remove all the custom collectstatic --ignore rules.  This makes it
much clearer what’s actually being served to the web, and what’s being
bundled by webpack.  It also shrinks the release tarball by 3%.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-02-23 16:04:17 -08:00

29 lines
669 B
Python
Executable File

#!/usr/bin/env python3
import json
import os
import sys
if sys.version_info < (3, 9):
from backports import zoneinfo
else:
import zoneinfo
ZULIP_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../")
sys.path.insert(0, ZULIP_PATH)
from zerver.lib.timezone import get_canonical_timezone_map
OUT_PATH = os.path.join(ZULIP_PATH, "web", "generated", "timezones.json")
with open(OUT_PATH, "w") as f:
json.dump(
{
"timezones": sorted(
zoneinfo.available_timezones()
- {"Factory", "localtime"}
- set(get_canonical_timezone_map())
)
},
f,
)