Skip to content

Commit

Permalink
Merge pull request #270 from vplan-fr/main
Browse files Browse the repository at this point in the history
2024-03-10-2
  • Loading branch information
Belissimo-T authored Mar 10, 2024
2 parents 048b58a + 4c6b589 commit 578da4d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion backend/plan_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def update_forms(self):
def update_rooms(self):
self._logger.info("* Updating rooms...")

parsed_rooms: dict[str, dict] = {room: None for room in self.meta_extractor.rooms()}
parsed_rooms: dict[str, dict | None] = {room: None for room in self.meta_extractor.rooms()}
try:
room_parser = schools.room_parsers[str(self.school_number)]
except KeyError:
Expand Down
16 changes: 10 additions & 6 deletions backend/vplan_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@
_parse_form_pattern = re.compile(
r"(?<!\S)(?:"
r"(?P<major>\d{1,2}(?!\d)|[A-Za-zÄÖÜäöüß]+(?![A-Za-zÄÖÜäöüß]))"
r"(?P<sep>[/.] |[^A-Za-zÄÖÜäöüß0-9() \n]?)"
r"(?P<minor>(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+?)(?:,(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+?))*)"
r"|(?P<alpha>\d{1,2})"
r"(?P<sep> |[/._]|[^A-Za-zÄÖÜäöüß0-9() \n]?)(?:(?<! ) )?"
r"(?P<minor>"
r"(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+\d{0,2})"
r"(?:,(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+\d{0,2}))*"
r")|(?P<alpha>\d{1,2})"
r")(?![^\s,:])"
)
_loose_parse_form_pattern = re.compile(
r"(?<!\S)(?:"
r"(?P<major>\d{1,2}(?!\d)|[A-Za-zÄÖÜäöüß]+(?![A-Za-zÄÖÜäöüß]))"
r"(?P<sep>[/.]? |[^A-Za-zÄÖÜäöüß0-9() \n]?)"
r"(?P<minor>(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+?)(?:,(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+?))*)"
r"|(?P<alpha>\d{1,2})"
r"(?P<sep> |[/._]|[^A-Za-zÄÖÜäöüß0-9() \n]?)(?:(?<! ) )?"
r"(?P<minor>"
r"(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+\d{0,2})"
r"(?:,(?:\d{1,2}[A-Za-zÄÖÜäöüß]?|[A-Za-zÄÖÜäöüß]+\d{0,2}))*"
r")|(?P<alpha>\d{1,2})"
r")(?![^\s,:()])"
)

Expand Down
2 changes: 1 addition & 1 deletion client/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export function format_date(date) {
const monthIndex = date.getMonth();
const year = date.getFullYear();

return `${weekday}., ${day}. ${months[monthIndex]} ${year}`;
return `${weekday}, ${day}. ${months[monthIndex]} ${year}`;

}

Expand Down
1 change: 1 addition & 0 deletions endpoints/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def plan(school_num: str) -> Response:
"plans": json.loads(cache.get_plan_file(date, revision, "plans.json")),
"exams": json.loads(cache.get_plan_file(date, revision, "exams.json")),
"grouped_form_plans": json.loads(cache.get_plan_file(date, revision, "grouped_form_plans.json")),
"last_fetch": json.loads(cache.get_meta_file("last_fetch.json"))["timestamp"]
}
except FileNotFoundError:
return send_error("Invalid date or revision.")
Expand Down

0 comments on commit 578da4d

Please sign in to comment.