def refresh_events(self):
now = datetime.datetime.now(tz=pytz.UTC)<EOL>try:<EOL><INDENT>now, later = self.get_timerange_formatted(now)<EOL>events_result = self.service.events().list(<EOL>calendarId='<STR_LIT>',<EOL>timeMin=now,<EOL>timeMax=later,<EOL>maxResults=<NUM_LIT:10>,<EOL>singleEvents=True,<EOL>orderBy='<STR_LIT>',<EOL>timeZone='<STR_LIT>'<EOL>).execute()<EOL>self.events.clear()<EOL>for event in events_result.get('<STR_LIT>', []):<EOL><INDENT>self.events.append(GoogleCalendarEvent(event))<EOL><DEDENT><DEDENT>except HttpError as e:<EOL><INDENT>if e.resp.status in (<NUM_LIT>, <NUM_LIT>):<EOL><INDENT>self.logger.warn("<STR_LIT>" % e.resp.status)<EOL><DEDENT>else:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>
Retrieve the next N events from Google.