MCPcopy Index your code
hub / github.com/googleapis/google-api-python-client / main

Function main

samples/calendar_api/calendar_sample.py:27–52  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

25
26
27def 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
55if __name__ == "__main__":

Callers 1

calendar_sample.pyFile · 0.70

Calls 2

executeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…