From 689abab1e9798308ee86be53e35faa833aaf5176 Mon Sep 17 00:00:00 2001 From: Emad Rad Date: Sat, 18 Nov 2023 18:39:54 +0330 Subject: [PATCH] fix: typing added --- tutorandroid/plugin.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tutorandroid/plugin.py b/tutorandroid/plugin.py index e044aa6..c273a20 100644 --- a/tutorandroid/plugin.py +++ b/tutorandroid/plugin.py @@ -7,11 +7,11 @@ import pkg_resources from tutor import hooks as tutor_hooks +from tutor.types import Config, get_typed from .__about__ import __version__ -config = { - "unique": {"OAUTH2_SECRET": "{{ 24|random_string }}"}, +config: t.Dict[str, t.Dict[str, t.Any]] = { "defaults": { "VERSION": __version__, "APP_HOST": "mobile.{{ LMS_HOST }}", @@ -63,7 +63,9 @@ @tutor_hooks.Filters.IMAGES_PULL.add() @tutor_hooks.Filters.IMAGES_PUSH.add() -def _add_remote_android_app_image_iff_customized(images, user_config): +def _add_remote_android_app_image_iff_customized( + images: list[tuple[str, str]], user_config: Config +) -> list[tuple[str, str]]: """ Register ANDROID-APP image for pushing & pulling if and only if it has been set to something other than the default. @@ -75,7 +77,7 @@ def _add_remote_android_app_image_iff_customized(images, user_config): to push/pull the ANDROID-APP image if the user has customized it to anything other than the default image URL. """ - image_tag = user_config["ANDROID_APP_DOCKER_IMAGE"] + image_tag = get_typed(user_config, "ANDROID_APP_DOCKER_IMAGE", str, "") if not image_tag.startswith("docker.io/overhangio/openedx-android-app:"): # Image has been customized. Add to list for pulling/pushing. images.append(("android-app", image_tag))