From 1a2ef7b74d843194cc2891048425a3848efe1428 Mon Sep 17 00:00:00 2001 From: Emad Rad Date: Sat, 18 Nov 2023 17:06:31 +0330 Subject: [PATCH] chore: cleanup --- tutorminio/__about__.py | 1 - tutorminio/plugin.py | 15 +++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tutorminio/__about__.py b/tutorminio/__about__.py index d945113..610c111 100644 --- a/tutorminio/__about__.py +++ b/tutorminio/__about__.py @@ -1,2 +1 @@ __version__ = "16.0.1" - diff --git a/tutorminio/plugin.py b/tutorminio/plugin.py index 14a8408..e888f10 100644 --- a/tutorminio/plugin.py +++ b/tutorminio/plugin.py @@ -16,7 +16,7 @@ HERE = os.path.abspath(os.path.dirname(__file__)) -config: t.Dict[str, t.Dict[str, t.Any]] = { +config: dict[str, dict[str, t.Any]] = { "defaults": { "VERSION": __version__, "BUCKET_NAME": "openedx", @@ -53,17 +53,16 @@ list(config.get("overrides", {}).items()) ) + @tutor_hooks.Filters.APP_PUBLIC_HOSTS.add() def add_minio_hosts( - hosts: list[str], context_name: Literal["local", "dev"] - ) -> list[str]: - if context_name == "dev": - hosts.append("{{ MINIO_CONSOLE_HOST }}:9001") - else: - hosts.append("{{ MINIO_CONSOLE_HOST }}") - + hosts: list[str], context_name: t.Literal["local", "dev"] +) -> list[str]: + port = ":9001" if context_name == "dev" else "" + hosts.append(f"{{{{MINIO_CONSOLE_HOST}}}}{port}") return hosts + # Add pre-init script as init task with high priority with open( os.path.join(HERE, "templates", "minio", "tasks", "minio", "init.sh"),