Create course root directory as needed
authorJakob <jakob@jcornell.net>
Mon, 2 Dec 2019 03:57:34 +0000 (21:57 -0600)
committerJakob <jakob@jcornell.net>
Mon, 2 Dec 2019 03:57:34 +0000 (21:57 -0600)
main.py

diff --git a/main.py b/main.py
index 5ea39fb5ad8342ff6c4bf20ab36d788fe205334d..e2d78db773824ea2165a8f86f6f47f12f97c11f1 100644 (file)
--- a/main.py
+++ b/main.py
@@ -85,6 +85,7 @@ with StorageManager(Path('auth_cache')) as storage_mgr:
        [content_id] = content_ids
 
        local_course_root = fs.WinPath(cfg_section['base_path'])
+       local_course_root.mkdir(parents = True, exist_ok = True)
        meta_path = local_course_root.get_ads(fs.BB_META_STREAM_NAME)
        if meta_path.is_file():
                with meta_path.open() as f:
@@ -167,11 +168,7 @@ with StorageManager(Path('auth_cache')) as storage_mgr:
                                        # versions match
                                        pass
                                elif isinstance(result, Result.MultipleLatest):
-                                       log(
-                                               'error',
-                                               "Identified multiple latest versions for {id}: {fileName}".format(**attachment_doc),
-                                               indent = 2,
-                                       )
+                                       log('error', "Identified multiple latest versions!", indent = 2)
                                        log(
                                                'error',
                                                "To allow the program to check this attachment, delete all or all but one of these files:",