Skip to content

Commit d8be6e7

Browse files
authored
Merge pull request #50 from filips123/fix-updaters
2 parents 91df1ab + 3b5a59a commit d8be6e7

File tree

6 files changed

+458
-465
lines changed

6 files changed

+458
-465
lines changed

API/gimvicurnik/updaters/eclassroom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,10 @@ def _normalize_classroom_name(self, name: str) -> Optional[str]:
299299

300300
# Special case: Classroom aliases
301301
# Maybe these mappings aren't correct, but who knows...
302-
if name == "Mala dvorana" or name == "Mala telovadnica":
303-
return "TV2"
304302
if name == "Velika dvorana" or name == "Velika telovadnica":
305303
return "TV1"
304+
if name == "Mala dvorana" or name == "Mala telovadnica":
305+
return "TV3"
306306

307307
# Return the normal name
308308
return name

API/gimvicurnik/updaters/menu.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,9 @@ def get_document_effective(self, document: DocumentInfo) -> datetime.date:
109109

110110
url = document.url
111111

112-
# Some empty strings are needed here because of a Black bug that removed our comments
113-
# TODO: Remove them once the project updates to Black 22.7 (or a version with the fix)
114-
# SEE: https://github.com/psf/black/issues/2646
115-
116112
# == FORMAT TYPE 1
117113
# Example: KOSILO-4jan-8jan-2021.pdf
118114
# Example: KOSILO-25jan-29jan-2021-PDF.pdf
119-
""
120115
date = re.search(r"(?:KOSILO|MALICA)-(\d+)([a-z]+)-\d+[a-z]+-(\d+)(?i:-PDF)?\.[a-z]+", url) # fmt: skip
121116

122117
if date:
@@ -132,8 +127,9 @@ def get_document_effective(self, document: DocumentInfo) -> datetime.date:
132127
# Example: 04-splet-marec-2-teden-04-M-PDF-0.pdf
133128
# Example: 01-splet-september-4-teden-02-M-popravek.pdf
134129
# Example: 01-splet-januar1-teden-02-K.pdf
135-
""
136-
date = re.search(r"\d+-splet-([a-z]+)-?(\d)-teden-?\d*-[MK]-?\d?(?i:-PDF)?(?:-[a-z]+)?(?:-\d)?\.[a-z]+", url) # fmt: skip
130+
# Example: 01-splet-september-2-teden-02.pdf
131+
# Example: 01-splet-september-2-teden-M-02.pdf
132+
date = re.search(r"\d+-splet-([a-z]+)-?(\d)-teden(?:-[MK])?-?\d*(?:-[MK])?-?\d?(?i:-PDF)?(?:-[a-z]+)?(?:-\d)?\.[a-z]+", url) # fmt: skip
137133

138134
if date:
139135
today = datetime.date.today()

0 commit comments

Comments
 (0)