Skip to content

Commit

Permalink
Merge pull request googleapis#196 from FrostmourneHungers/patch-1
Browse files Browse the repository at this point in the history
Correcting CalendarColors names
  • Loading branch information
Alejandro Casanovas committed Feb 28, 2019
2 parents 0893020 + bb2dda0 commit 92d6d44
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions O365/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,18 @@ class EventShowAs(Enum):


class CalendarColors(Enum):
LightBlue = 0
LightGreen = 1
LightOrange = 2
LightGray = 3
LightYellow = 4
LightTeal = 5
LightPink = 6
LightBrown = 7
LightRed = 8
MaxColor = 9
Auto = -1
LightBlue = 'lightBlue'
LightGreen = 'lightGreen'
LightOrange = 'lightOrange'
LightGray = 'lightGray'
LightYellow = 'lightYellow'
LightTeal = 'lightTeal'
LightPink = 'lightPink'
LightBrown = 'lightBrown'
LightRed = 'lightRed'
MaxColor = 'maxColor'
Auto = 'auto'



class EventType(Enum):
Expand Down Expand Up @@ -1494,11 +1495,11 @@ def __init__(self, *, parent=None, con=None, **kwargs):
self.calendar_id = cloud_data.get(self._cc('id'), None)
self.__owner = self._recipient_from_cloud(
cloud_data.get(self._cc('owner'), {}), field='owner')
color = cloud_data.get(self._cc('color'), -1)
if isinstance(color, str):
color = -1 if color == 'auto' else color
# TODO: other string colors?
self.color = CalendarColors(color)
color = cloud_data.get(self._cc('color'), 'auto')
try:
self.color = CalendarColors(color)
except:
self.color = CalendarColors('auto')
self.can_edit = cloud_data.get(self._cc('canEdit'), False)
self.can_share = cloud_data.get(self._cc('canShare'), False)
self.can_view_private_items = cloud_data.get(
Expand Down

0 comments on commit 92d6d44

Please sign in to comment.