(argv)
| 25 | |
| 26 | |
| 27 | def main(argv): |
| 28 | # Authenticate and construct service. |
| 29 | service, flags = sample_tools.init( |
| 30 | argv, |
| 31 | "calendar", |
| 32 | "v3", |
| 33 | __doc__, |
| 34 | __file__, |
| 35 | scope="https://www.googleapis.com/auth/calendar.readonly", |
| 36 | ) |
| 37 | |
| 38 | try: |
| 39 | page_token = None |
| 40 | while True: |
| 41 | calendar_list = service.calendarList().list(pageToken=page_token).execute() |
| 42 | for calendar_list_entry in calendar_list["items"]: |
| 43 | print(calendar_list_entry["summary"]) |
| 44 | page_token = calendar_list.get("nextPageToken") |
| 45 | if not page_token: |
| 46 | break |
| 47 | |
| 48 | except client.AccessTokenRefreshError: |
| 49 | print( |
| 50 | "The credentials have been revoked or expired, please re-run" |
| 51 | "the application to re-authorize." |
| 52 | ) |
| 53 | |
| 54 | |
| 55 | if __name__ == "__main__": |
no test coverage detected
searching dependent graphs…