2017-08-22 00:18:59 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2017-09-26 01:10:11 +02:00
|
|
|
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
2017-08-22 00:18:59 +02:00
|
|
|
sys.path.append(ZULIP_PATH)
|
2020-06-11 00:54:34 +02:00
|
|
|
from scripts.lib import clean_emoji_cache, clean_node_cache, clean_venv_cache
|
2019-02-02 23:53:23 +01:00
|
|
|
from scripts.lib.zulip_tools import parse_cache_script_args
|
2020-06-11 00:54:34 +02:00
|
|
|
|
2017-08-22 00:18:59 +02:00
|
|
|
|
python: Convert function type annotations to Python 3 style.
Generated by com2ann (slightly patched to avoid also converting
assignment type annotations, which require Python 3.6), followed by
some manual whitespace adjustment, and six fixes for runtime issues:
- def __init__(self, token: Token, parent: Optional[Node]) -> None:
+ def __init__(self, token: Token, parent: "Optional[Node]") -> None:
-def main(options: argparse.Namespace) -> NoReturn:
+def main(options: argparse.Namespace) -> "NoReturn":
-def fetch_request(url: str, callback: Any, **kwargs: Any) -> Generator[Callable[..., Any], Any, None]:
+def fetch_request(url: str, callback: Any, **kwargs: Any) -> "Generator[Callable[..., Any], Any, None]":
-def assert_server_running(server: subprocess.Popen[bytes], log_file: Optional[str]) -> None:
+def assert_server_running(server: "subprocess.Popen[bytes]", log_file: Optional[str]) -> None:
-def server_is_up(server: subprocess.Popen[bytes], log_file: Optional[str]) -> bool:
+def server_is_up(server: "subprocess.Popen[bytes]", log_file: Optional[str]) -> bool:
- method_kwarg_pairs: List[FuncKwargPair],
+ method_kwarg_pairs: "List[FuncKwargPair]",
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-19 03:48:37 +02:00
|
|
|
def main() -> None:
|
2020-10-23 02:43:28 +02:00
|
|
|
args = parse_cache_script_args("This script cleans unused Zulip caches.")
|
2017-08-22 00:18:59 +02:00
|
|
|
os.chdir(ZULIP_PATH)
|
2018-06-18 16:28:34 +02:00
|
|
|
clean_venv_cache.main(args)
|
|
|
|
clean_node_cache.main(args)
|
|
|
|
clean_emoji_cache.main(args)
|
2017-08-22 00:18:59 +02:00
|
|
|
|
2021-02-12 08:19:30 +01:00
|
|
|
|
2017-08-22 00:18:59 +02:00
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|