Add basic event summary and description

Summary is the title of the event in your calendar, so we want it to be
a little less verbose.
This commit is contained in:
Ian Adam Naval 2019-01-21 22:13:59 -05:00
parent 9f45f06092
commit 82b734d1a8
3 changed files with 11 additions and 2 deletions

View File

@ -13,6 +13,7 @@ def add_vevent(cal: VCalendar2_0, reservation: Reservation):
vevent.add('dtstart').value = reservation.start
vevent.add('dtend').value = reservation.end
vevent.add('summary').value = reservation.summary
vevent.add('description').value = reservation.description
return cal

View File

@ -14,4 +14,12 @@ class Reservation(object):
start: pendulum.DateTime
end: pendulum.DateTime
comments: str
summary: str
raw: str
@property
def summary(self):
return f"Flying {self.aircraft} with {self.instructor}"
@property
def description(self):
return self.raw

View File

@ -90,7 +90,7 @@ def make_reservation_from_tag(tag: Tag) -> Reservation:
strict=False,
tz=config.TIME_ZONE)
attributes[datetime_attr] = parsed_datetime
attributes['summary'] = raw
attributes['raw'] = raw.replace('\r', '').replace('\t', '')
return Reservation(**attributes)