-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
387 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
from typing import cast, Any | ||
from typing import Optional | ||
|
||
from icalendar import Event | ||
|
||
from calendar_connector.consts import EVENT_TYPE | ||
from calendar_connector.normalize import normalize | ||
from calendar_connector.types.event_type import EventType | ||
|
||
|
||
def extract_event_location(event_data: EVENT_TYPE, event: Event) -> None: | ||
def extract_event_location(event_data: Optional[EventType], event: Event) -> None: | ||
if event_data is None or event_data["location"] is None: | ||
return | ||
|
||
location = normalize( | ||
cast( | ||
dict[str, str | Any], | ||
event_data["location"], | ||
)["formatted_address"] | ||
) | ||
location = normalize(event_data["location"]["formatted_address"]) | ||
event.add("location", location) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
from typing import TypedDict, Any, Optional | ||
|
||
from calendar_connector.types.season_type import SeasonType | ||
from calendar_connector.types.shared_type import CountryType | ||
|
||
|
||
class LocationType(TypedDict): | ||
id: int | ||
is_stadium: bool | ||
lat: float | ||
lng: float | ||
name: str | ||
url: str | ||
formatted_address: str | ||
country: CountryType | ||
|
||
|
||
class GroupType(TypedDict): | ||
attendance_status: str | ||
importance_level: int | ||
localized_name: str | ||
slug_name: str | ||
target_groups: list[str] | ||
|
||
|
||
class OpponentType(TypedDict): | ||
id: str | ||
full_name: str | ||
is_current_team: bool | ||
is_home: bool | ||
jersey_color: Optional[Any] | ||
match_outcome: str | ||
score: int | ||
short_name: str | ||
|
||
|
||
class AttendanceGroupType(TypedDict): | ||
attendance_status: str | ||
count: int | ||
importance_level: int | ||
localized_name: str | ||
slug_name: str | ||
|
||
|
||
class CategoryType(TypedDict): | ||
championship_day: int | ||
id: int | ||
localized_name: str | ||
slug_name: str | ||
type: str | ||
|
||
|
||
class RegistrationParametersType(TypedDict): | ||
hide_attendance: bool | ||
|
||
|
||
class MeType(TypedDict): | ||
group: GroupType | ||
opponent: str | ||
url: str | ||
|
||
|
||
class EventType(TypedDict): | ||
id: int | ||
name: str | ||
start_at: str | ||
end_at: str | ||
url: str | ||
thread_id: int | ||
location: LocationType | ||
available_threshold_reached: bool | ||
can_see_attendance: bool | ||
is_cancelled: bool | ||
is_date_unknown: bool | ||
is_past: bool | ||
is_recurring: bool | ||
is_sportive: bool | ||
me: MeType | ||
opponent_left: Optional[OpponentType] | ||
opponent_right: Optional[OpponentType] | ||
registration_open_at: str | ||
step: str | ||
attendance_groups: list[AttendanceGroupType] | ||
category: CategoryType | ||
registration_parameters: RegistrationParametersType | ||
season: SeasonType |
Oops, something went wrong.