mirror of
				https://github.com/b4tman/sync_ics2gcal
				synced 2025-11-04 12:38:32 +00:00 
			
		
		
		
	fix typo
This commit is contained in:
		@@ -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 = {
 | 
			
		||||
 
 | 
			
		||||
@@ -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))
 | 
			
		||||
 
 | 
			
		||||
@@ -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)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user