From d11f62b30cea67cc724117aef276573d65aadc8f Mon Sep 17 00:00:00 2001 From: Tuomas Laine Date: Fri, 25 Aug 2023 16:12:28 +0000 Subject: [PATCH] Cleanup Remove two unused imports and fix a type hint --- access/config.py | 2 +- builder/builder.py | 3 +-- util/files.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/access/config.py b/access/config.py index a547db1..3848e1b 100644 --- a/access/config.py +++ b/access/config.py @@ -22,7 +22,7 @@ from util.pydantic import Undefined, validation_error_str, validation_warning_str from util.static import static_path, symbolic_link from builder.models import Course as CourseModel -from .course import Course, Exercise, Parent, ExerciseConfig +from .course import Course, Exercise, ExerciseConfig from .parser import ConfigParser, ConfigError META = "apps.meta" diff --git a/builder/builder.py b/builder/builder.py index 712df6c..f8ec75e 100644 --- a/builder/builder.py +++ b/builder/builder.py @@ -24,14 +24,13 @@ from aplus_auth.payload import Permission, Permissions from aplus_auth.requests import post -from access.config import INDEX, ConfigSource, CourseConfig, load_meta, META +from access.config import ConfigSource, CourseConfig, load_meta, META from access.parser import ConfigError from builder.configure import configure_graders, publish_graders from util.files import ( copyfile, copys_async, is_subpath, - readfile, renames, rm_except, FileLock, diff --git a/util/files.py b/util/files.py index 0a0ad74..c0eb5fb 100644 --- a/util/files.py +++ b/util/files.py @@ -57,7 +57,7 @@ def rm_paths(paths: Iterable[Union[str, Path]]) -> None: def rm_except(dir: PathLike, exclude: PathLike) -> None: """Remove directory contents except for """ - def inner(dir: PathLike, exclude: PathLike, exclude_parents: Set[Path]): + def inner(dir: PathLike, exclude: PathLike, exclude_parents: Set[str]): with os.scandir(dir) as it: for direntry in it: if exclude == direntry.path: