Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

Commit

Permalink
Fixed exclude-day bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Mroik committed May 12, 2021
1 parent c096077 commit 1ae97cd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pip install prenotazione-unimi

Utilizzo
=======
Per vedere tutti gli utilizzi esegui `python3 main.py --help`. Puoi specificare
Per vedere tutti gli utilizzi esegui `prenotazione-unimi --help`. Puoi specificare
i parametri `--username`, `--password` e `--cf-code` utilizzando
rispettivamente le variabili d'ambiente `UNIMI_USERNAME`, `UNIMI_PASSWORD` e
`UNIMI_CF`.
Expand Down
5 changes: 3 additions & 2 deletions prenotazione_unimi/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,16 @@ def book_lesson(args):
lectures = es.get_all_lectures()
date = helpers.parse_date(args.date)
booked = []
args.exclude_day = helpers.parse_weekday(args.exclude_day)
if args.exclude_day:
args.exclude_day = helpers.parse_weekday(args.exclude_day)
for lecture in lectures:
if args.date and date != lecture["date"]:
continue
if args.id and lecture["entry_id"] not in args.id:
continue
if args.exclude and any([bool(s.lower() in lecture["nome"].lower()) for s in args.exclude]):
continue
if lecture["date"].weekday() in args.exclude_day:
if args.exclude_day and lecture["date"].weekday() in args.exclude_day:
continue
es.book_lecture(lecture["entry_id"], dummy=args.dry_run)
booked.append(lecture)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="prenotazione-unimi",
version="1.0.1",
version="1.0.3",
author="Mroik",
author_email="[email protected]",
description="Command line program that handles booking for lessons at UNIMI and other stuff.",
Expand Down

0 comments on commit 1ae97cd

Please sign in to comment.