kopia lustrzana https://github.com/jazzband/icalevents
commit
1d169f5dcf
|
@ -41,6 +41,7 @@ class Event:
|
|||
self.end = None
|
||||
self.all_day = True
|
||||
self.recurring = False
|
||||
self.location = None
|
||||
|
||||
def time_left(self, time=now()):
|
||||
"""
|
||||
|
@ -115,6 +116,7 @@ class Event:
|
|||
|
||||
ne.all_day = self.all_day
|
||||
ne.recurring = self.recurring
|
||||
ne.location = self.location
|
||||
ne.uid = uid
|
||||
|
||||
return ne
|
||||
|
@ -140,11 +142,21 @@ def create_event(component, tz=UTC):
|
|||
else: # compute implicit end as start + 0
|
||||
event.end = event.start
|
||||
|
||||
event.summary = str(component.get('summary'))
|
||||
event.description = str(component.get('description'))
|
||||
try:
|
||||
event.summary = str(component.get('summary'))
|
||||
except UnicodeEncodeError as e:
|
||||
event.summary = str(component.get('summary').encode('utf-8'))
|
||||
try:
|
||||
event.description = str(component.get('description'))
|
||||
except UnicodeEncodeError as e:
|
||||
event.description = str(component.get('description').encode('utf-8'))
|
||||
event.all_day = type(component.get('dtstart').dt) is date
|
||||
if component.get('rrule'):
|
||||
event.recurring = True
|
||||
try:
|
||||
event.location = str(component.get('location'))
|
||||
except UnicodeEncodeError as e:
|
||||
event.location = str(component.get('location').encode('utf-8'))
|
||||
return event
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue