Skip to content

Commit

Permalink
Merge pull request #55 from infanf/master
Browse files Browse the repository at this point in the history
add private event attribute
  • Loading branch information
Thomas Irgang authored Jul 18, 2019
2 parents bb34c77 + ce6982b commit c962673
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions icalevents/icalparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def __init__(self):
self.all_day = True
self.recurring = False
self.location = None
self.private = False

def time_left(self, time=None):
"""
Expand Down Expand Up @@ -114,6 +115,7 @@ def copy_to(self, new_start=None, uid=None):
ne.all_day = self.all_day
ne.recurring = self.recurring
ne.location = self.location
ne.private = self.private
ne.uid = uid

return ne
Expand Down Expand Up @@ -171,6 +173,10 @@ def create_event(component, tz=UTC):
if component.get('organizer'):
event.organizer = component.get('organizer').encode('utf-8').decode('ascii')

if component.get('class'):
event_class = component.get('class')
event.private = event_class == 'PRIVATE' or event_class == 'CONFIDENTIAL'

return event


Expand Down

0 comments on commit c962673

Please sign in to comment.