Skip to content

Commit

Permalink
Fixes #23 and hopefully fixes #21.
Browse files Browse the repository at this point in the history
Tries to retrieve all calendars.  Upon success, continues.  Upon
failure, prints the exception and tries again in 5 seconds, until
forever.
  • Loading branch information
jayr0d committed Oct 20, 2012
1 parent 09c6353 commit 5dfbca2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gnome-shell-google-calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,15 @@ def get_excludes(self, filename):
return frozenset(line.strip() for line in fp)

def get_calendars(self):
feed = self.client.GetAllCalendarsFeed()
while True:
try:
feed = self.client.GetAllCalendarsFeed()
break
except Exception, e:
print '*** Exception:', e
print 'Error retrieving all calendars. Trying again in 5 seconds...'
sleep(5)
continue

# Load excluded calendars from excludes file
excludes = set()
Expand Down

0 comments on commit 5dfbca2

Please sign in to comment.