Skip to content

Commit

Permalink
Merge pull request #24 from johnnyg/master
Browse files Browse the repository at this point in the history
Use overridename if available
  • Loading branch information
vintitres committed May 13, 2012
2 parents 1e317a3 + 8cff2c1 commit 0c029fb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gnome-shell-google-calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,25 +241,28 @@ def scheduler(self, timeout):
def get_excludes(self, filename):
'''Gets a list of calendars to exclude'''
with open(filename, 'r') as fp:
return [line.strip() for line in fp]
return frozenset(line.strip() for line in fp)

def get_calendars(self):
feed = self.client.GetAllCalendarsFeed()

# Load excluded calendars from excludes file
excludes = []
excludes = set()
for filename in ('excludes',
os.path.expanduser('~/.gnome-shell-google-calendar-excludes')):
if os.path.exists(filename):
excludes += self.get_excludes(filename)
excludes |= self.get_excludes(filename)

calendars = []
urls = set()

print feed.title.text + ':'

for calendar in feed.entry:
title = calendar.title.text
if calendar.overridename:
title = calendar.overridename.value
else:
title = calendar.title.text
url = calendar.content.src

if title in excludes:
Expand Down

0 comments on commit 0c029fb

Please sign in to comment.