From ca8fcf7a1dcdde89caab549869fc234930271e54 Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Thu, 23 Apr 2020 20:22:41 +0200 Subject: [PATCH] Somewhat elaborate example_config --- example_config.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/example_config.py b/example_config.py index b8059c1..af5c2f0 100644 --- a/example_config.py +++ b/example_config.py @@ -1,13 +1,33 @@ +""" +A small sample config for PFERD. +""" from pathlib import Path from PFERD import Pferd, enable_logging +from PFERD.ilias.download_strategies import (download_everything, + download_modified_or_new) def main() -> None: enable_logging() pferd = Pferd(Path(__file__).parent) - pferd.ilias_kit(Path("DB"), "1101554", cookies=Path("ilias_cookies.txt")) + # Synchronize "databases" and only download files with a more recent timestamp than + # the local copy, if any exists. + pferd.ilias_kit( + Path("DB"), + "1101554", + cookies=Path("ilias_cookies.txt"), + download_strategy=download_modified_or_new + ) + + # Synchronize "databases" and redownload every file (default). + pferd.ilias_kit( + Path("DB"), + "1101554", + cookies=Path("ilias_cookies.txt"), + download_strategy=download_everything + ) if __name__ == "__main__":