mirror of
https://github.com/Garmelon/PFERD.git
synced 2026-04-13 07:55:05 +02:00
Add KeyboardInterrupt detection
This commit is contained in:
parent
35c3fa205d
commit
86062f0b3f
2 changed files with 62 additions and 53 deletions
|
|
@ -75,57 +75,62 @@ def main() -> None:
|
||||||
pferd = Pferd(Path(__file__).parent, test_run=args.test_run)
|
pferd = Pferd(Path(__file__).parent, test_run=args.test_run)
|
||||||
pferd.enable_logging()
|
pferd.enable_logging()
|
||||||
|
|
||||||
if not args.synchronizers or "numerik" in args.synchronizers:
|
try:
|
||||||
pferd.ilias_kit(
|
if not args.synchronizers or "numerik" in args.synchronizers:
|
||||||
target="Numerik",
|
pferd.ilias_kit(
|
||||||
course_id="1083036",
|
target="Numerik",
|
||||||
transform=tf_ss_2020_numerik,
|
course_id="1083036",
|
||||||
cookies="ilias_cookies.txt",
|
transform=tf_ss_2020_numerik,
|
||||||
)
|
cookies="ilias_cookies.txt",
|
||||||
|
)
|
||||||
|
|
||||||
if not args.synchronizers or "db" in args.synchronizers:
|
if not args.synchronizers or "db" in args.synchronizers:
|
||||||
pferd.ilias_kit(
|
pferd.ilias_kit(
|
||||||
target="DB",
|
target="DB",
|
||||||
course_id="1101554",
|
course_id="1101554",
|
||||||
transform=tf_ss_2020_db,
|
transform=tf_ss_2020_db,
|
||||||
cookies="ilias_cookies.txt",
|
cookies="ilias_cookies.txt",
|
||||||
)
|
)
|
||||||
|
|
||||||
if not args.synchronizers or "rechnernetze" in args.synchronizers:
|
if not args.synchronizers or "rechnernetze" in args.synchronizers:
|
||||||
pferd.ilias_kit(
|
pferd.ilias_kit(
|
||||||
target="Rechnernetze",
|
target="Rechnernetze",
|
||||||
course_id="1099996",
|
course_id="1099996",
|
||||||
transform=tf_ss_2020_rechnernetze,
|
transform=tf_ss_2020_rechnernetze,
|
||||||
cookies="ilias_cookies.txt",
|
cookies="ilias_cookies.txt",
|
||||||
)
|
)
|
||||||
|
|
||||||
if not args.synchronizers or "sicherheit" in args.synchronizers:
|
if not args.synchronizers or "sicherheit" in args.synchronizers:
|
||||||
pferd.ilias_kit(
|
pferd.ilias_kit(
|
||||||
target="Sicherheit",
|
target="Sicherheit",
|
||||||
course_id="1101980",
|
course_id="1101980",
|
||||||
transform=tf_ss_2020_sicherheit,
|
transform=tf_ss_2020_sicherheit,
|
||||||
cookies="ilias_cookies.txt",
|
cookies="ilias_cookies.txt",
|
||||||
)
|
)
|
||||||
|
|
||||||
if not args.synchronizers or "pg" in args.synchronizers:
|
if not args.synchronizers or "pg" in args.synchronizers:
|
||||||
pferd.ilias_kit(
|
pferd.ilias_kit(
|
||||||
target="PG",
|
target="PG",
|
||||||
course_id="1106095",
|
course_id="1106095",
|
||||||
transform=tf_ss_2020_pg,
|
transform=tf_ss_2020_pg,
|
||||||
cookies="ilias_cookies.txt",
|
cookies="ilias_cookies.txt",
|
||||||
)
|
)
|
||||||
|
|
||||||
if not args.synchronizers or "or1" in args.synchronizers:
|
if not args.synchronizers or "or1" in args.synchronizers:
|
||||||
pferd.ilias_kit(
|
pferd.ilias_kit(
|
||||||
target="OR1",
|
target="OR1",
|
||||||
course_id="1105941",
|
course_id="1105941",
|
||||||
dir_filter=df_ss_2020_or1,
|
dir_filter=df_ss_2020_or1,
|
||||||
transform=tf_ss_2020_or1,
|
transform=tf_ss_2020_or1,
|
||||||
cookies="ilias_cookies.txt",
|
cookies="ilias_cookies.txt",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print("Exiting early.")
|
||||||
|
finally:
|
||||||
|
# Prints a summary listing all new, modified or deleted files
|
||||||
|
pferd.print_summary()
|
||||||
|
|
||||||
# Prints a summary listing all new, modified or deleted files
|
|
||||||
pferd.print_summary()
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
|
||||||
|
|
@ -23,15 +23,19 @@ def main() -> None:
|
||||||
pferd = Pferd(Path(__file__).parent, test_run=args.test_run)
|
pferd = Pferd(Path(__file__).parent, test_run=args.test_run)
|
||||||
pferd.enable_logging()
|
pferd.enable_logging()
|
||||||
|
|
||||||
# Synchronize the personal desktop into the "ILIAS" directory.
|
try:
|
||||||
# It saves the cookies, so you only need to log in again when the ILIAS cookies expire.
|
# Synchronize the personal desktop into the "ILIAS" directory.
|
||||||
pferd.ilias_kit_personal_desktop(
|
# It saves the cookies, so you only need to log in again when the ILIAS cookies expire.
|
||||||
"ILIAS",
|
pferd.ilias_kit_personal_desktop(
|
||||||
cookies="ilias_cookies.txt",
|
"ILIAS",
|
||||||
)
|
cookies="ilias_cookies.txt",
|
||||||
|
)
|
||||||
|
|
||||||
# Prints a summary listing all new, modified or deleted files
|
except KeyboardInterrupt:
|
||||||
pferd.print_summary()
|
print("Exiting early...")
|
||||||
|
finally:
|
||||||
|
# Prints a summary listing all new, modified or deleted files
|
||||||
|
pferd.print_summary()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue