Somewhat elaborate example_config

This commit is contained in:
I-Al-Istannen 2020-04-23 20:22:41 +02:00
parent 980f69b5af
commit ca8fcf7a1d

View File

@ -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__":