Skip to content

Commit

Permalink
Make excludes a set rather than a list
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyg committed May 13, 2012
1 parent dbf17fe commit 8cff2c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gnome-shell-google-calendar.py
Expand Up @@ -241,17 +241,17 @@ 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()
Expand Down

0 comments on commit 8cff2c1

Please sign in to comment.