mirror of
https://github.com/b4tman/sync_ics2gcal
synced 2026-07-27 04:02:54 +03:00
Compare commits
17 Commits
98cd8428d6
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| d409c8687e | |||
| 3e84f26c47 | |||
| c53b783a06 | |||
| 77dfe921bf | |||
| f83eaf1f2c | |||
| e059f33e1c | |||
| 8bdce1b5f5 | |||
| 092911262c | |||
| 3f7bd864c9 | |||
| b9a0bac78e | |||
| c31c7ed7a9 | |||
| 0cb54571ee | |||
| 53694d8754 | |||
| 7d51ebcc44 | |||
| 81ee36bc57 | |||
| 64baa3cbb9 | |||
| b9dd093ca5 |
Generated
+479
-439
File diff suppressed because it is too large
Load Diff
+7
-4
@@ -19,10 +19,10 @@ classifiers = [
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.11"
|
||||
google-auth = "2.48.0"
|
||||
google-api-python-client = "2.190.0"
|
||||
icalendar = "7.0.2"
|
||||
pytz = "2025.2"
|
||||
google-auth = "2.55.1"
|
||||
google-api-python-client = "2.198.0"
|
||||
icalendar = "7.2.0"
|
||||
pytz = "2026.2"
|
||||
PyYAML = "6.0.3"
|
||||
fire = "0.7.1"
|
||||
|
||||
@@ -57,6 +57,9 @@ manage-ics2gcal = "sync_ics2gcal.manage_calendars:main"
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.mypy]
|
||||
disable_error_code = "unused-ignore"
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = [
|
||||
'icalendar',
|
||||
|
||||
@@ -120,7 +120,7 @@ class GoogleCalendarService:
|
||||
scopes = ["https://www.googleapis.com/auth/calendar"]
|
||||
credentials = service_account.Credentials.from_service_account_file(
|
||||
service_account_file
|
||||
)
|
||||
) # type: ignore[no-untyped-call]
|
||||
scoped_credentials = credentials.with_scopes(scopes)
|
||||
service = discovery.build(
|
||||
"calendar", "v3", credentials=scoped_credentials, cache_discovery=False
|
||||
|
||||
@@ -182,12 +182,12 @@ class CalendarConverter:
|
||||
def load(self, filename: str) -> None:
|
||||
"""load calendar from ics file"""
|
||||
with open(filename, "r", encoding="utf-8") as f:
|
||||
self.calendar = Calendar.from_ical(f.read())
|
||||
self.calendar = cast(Calendar, Calendar.from_ical(f.read())) # type: ignore[redundant-cast]
|
||||
self.logger.info("%s loaded", filename)
|
||||
|
||||
def loads(self, string: str) -> None:
|
||||
"""load calendar from ics string"""
|
||||
self.calendar = Calendar.from_ical(string)
|
||||
self.calendar = cast(Calendar, Calendar.from_ical(string)) # type: ignore[redundant-cast]
|
||||
|
||||
def events_to_gcal(self) -> EventList:
|
||||
"""Convert events to google calendar resources"""
|
||||
@@ -195,10 +195,10 @@ class CalendarConverter:
|
||||
if self.calendar is None:
|
||||
raise ValueError("calendar not set")
|
||||
|
||||
calendar: Calendar = cast(Calendar, self.calendar)
|
||||
calendar: Calendar = cast(Calendar, self.calendar) # type: ignore[redundant-cast]
|
||||
ics_events = calendar.walk(name="VEVENT")
|
||||
self.logger.info("%d events read", len(ics_events))
|
||||
|
||||
result = list(map(lambda event: EventConverter(event).convert(), ics_events))
|
||||
result = list(map(lambda event: EventConverter(event).convert(), ics_events)) # type: ignore[no-untyped-call]
|
||||
self.logger.info("%d events converted", len(result))
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user