From f0a7668fcd09e5c1c1735a1d0b263a9c5185ea6e Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 24 Feb 2022 12:34:41 +0300 Subject: [PATCH] fix typo --- sync_ics2gcal/gcal.py | 4 ++-- sync_ics2gcal/ical.py | 10 +++++----- sync_ics2gcal/sync.py | 18 +++++++++--------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sync_ics2gcal/gcal.py b/sync_ics2gcal/gcal.py index 0e97ad1..1e68e8e 100644 --- a/sync_ics2gcal/gcal.py +++ b/sync_ics2gcal/gcal.py @@ -85,7 +85,7 @@ def select_event_key(event: EventData) -> Optional[str]: class GoogleCalendar: - """class to interact with calendar on google + """class to interact with calendar on Google """ logger = logging.getLogger('GoogleCalendar') @@ -312,7 +312,7 @@ class GoogleCalendar: self.service.calendars().delete(calendarId=self.calendar_id).execute() def make_public(self): - """make calendar puplic + """make calendar public """ rule_public = { diff --git a/sync_ics2gcal/ical.py b/sync_ics2gcal/ical.py index 02bde16..5f9e78e 100644 --- a/sync_ics2gcal/ical.py +++ b/sync_ics2gcal/ical.py @@ -65,7 +65,7 @@ class EventConverter(Event): """decoded string property Arguments: - prop - propperty name + prop - property name Returns: string value @@ -107,7 +107,7 @@ class EventConverter(Event): dict """ - result = None + result: Dict[str, str] if 'DTEND' in self: value = self.decoded('DTEND') result = gcal_date_or_datetime(value) @@ -124,10 +124,10 @@ class EventConverter(Event): def _put_to_gcal(self, gcal_event: EventData, prop: str, func: Callable[[str], str], ics_prop: Optional[str] = None): - """get property from ical event if exist, and put to gcal event + """get property from ical event if existed, and put to gcal event Arguments: - gcal_event -- dest event + gcal_event -- destination event prop -- property name func -- function to convert ics_prop -- ical property name (default: {None}) @@ -191,7 +191,7 @@ class CalendarConverter: """ ics_events = self.calendar.walk(name='VEVENT') - self.logger.info('%d events readed', len(ics_events)) + self.logger.info('%d events read', len(ics_events)) result = list( map(lambda event: EventConverter(event).to_gcal(), ics_events)) diff --git a/sync_ics2gcal/sync.py b/sync_ics2gcal/sync.py index 1c56f6d..5175e2f 100644 --- a/sync_ics2gcal/sync.py +++ b/sync_ics2gcal/sync.py @@ -11,7 +11,7 @@ from .ical import CalendarConverter, DateDateTime class CalendarSync: - """class for syncronize calendar with google + """class for synchronize calendar with Google """ logger = logging.getLogger('CalendarSync') @@ -32,7 +32,7 @@ class CalendarSync: Arguments: items_src {list of dict} -- source events - items_dst {list of dict} -- dest events + items_dst {list of dict} -- destination events key {str} -- name of key to compare (default: {'iCalUID'}) Returns: @@ -90,10 +90,10 @@ class CalendarSync: Arguments: events -- events list date {datetime} -- datetime to compare - op {operator} -- comparsion operator + op {operator} -- comparison operator Returns: - list of filtred events + list of filtered events """ def filter_by_date(event: EventData) -> bool: @@ -120,13 +120,13 @@ class CalendarSync: @staticmethod def _tz_aware_datetime(date: DateDateTime) -> datetime.datetime: - """make tz aware datetime from datetime/date (utc if no tzinfo) + """make tz aware datetime from datetime/date (utc if no tz-info) Arguments: - date - date or datetime / with or without tzinfo + date - date or datetime / with or without tz-info Returns: - datetime with tzinfo + datetime with tz-info """ if not isinstance(date, datetime.datetime): @@ -136,7 +136,7 @@ class CalendarSync: return date def prepare_sync(self, start_date: DateDateTime) -> None: - """prepare sync lists by comparsion of events + """prepare sync lists by comparison of events Arguments: start_date -- date/datetime to start sync @@ -153,7 +153,7 @@ class CalendarSync: events_src_past = CalendarSync._filter_events_by_date( events_src, start_date, operator.lt) - # first events comparsion + # first events comparison self.to_insert, self.to_update, self.to_delete = CalendarSync._events_list_compare( events_src_pending, events_dst)