|
32 | 32 | display = graphics.display |
33 | 33 |
|
34 | 34 | background = Rect(0, 0, 296, 128, fill=0xFFFFFF) |
35 | | -graphics.splash.append(background) |
| 35 | +graphics.root_group.append(background) |
36 | 36 |
|
37 | 37 | label_overview_text = Label( |
38 | 38 | font_large, |
|
42 | 42 | color=0x000000, |
43 | 43 | text="Authorize this device with Google:", |
44 | 44 | ) |
45 | | -graphics.splash.append(label_overview_text) |
| 45 | +graphics.root_group.append(label_overview_text) |
46 | 46 |
|
47 | 47 | label_verification_url = Label(font_small, x=0, y=40, line_spacing=0.75, color=0x000000) |
48 | | -graphics.splash.append(label_verification_url) |
| 48 | +graphics.root_group.append(label_verification_url) |
49 | 49 |
|
50 | 50 | label_user_code = Label(font_small, x=0, y=80, color=0x000000, line_spacing=0.75) |
51 | | -graphics.splash.append(label_user_code) |
| 51 | +graphics.root_group.append(label_user_code) |
52 | 52 |
|
53 | 53 | label_qr_code = Label( |
54 | 54 | font_small, x=0, y=100, color=0x000000, text="Or scan the QR code:" |
55 | 55 | ) |
56 | | -graphics.splash.append(label_qr_code) |
| 56 | +graphics.root_group.append(label_qr_code) |
57 | 57 |
|
58 | 58 | # Set scope(s) of access required by the API you're using |
59 | 59 | scopes = ["https://www.googleapis.com/auth/calendar.readonly"] |
|
85 | 85 | label_user_code.text = "2. Enter code: %s" % google_auth.user_code |
86 | 86 |
|
87 | 87 | graphics.qrcode(google_auth.verification_url.encode(), qr_size=2, x=240, y=70) |
88 | | -graphics.display.root_group = graphics.splash |
| 88 | +graphics.display.root_group = graphics.root_group |
89 | 89 | display.refresh() |
90 | 90 |
|
91 | 91 | # Poll Google's authorization server |
|
98 | 98 | print(f'google_access_token="{google_auth.access_token}"') |
99 | 99 | print(f'google_refresh_token="{google_auth.refresh_token}"') |
100 | 100 |
|
101 | | -graphics.splash.pop() |
102 | | -graphics.splash.pop() |
103 | | -graphics.splash.pop() |
| 101 | +graphics.root_group.pop() |
| 102 | +graphics.root_group.pop() |
| 103 | +graphics.root_group.pop() |
104 | 104 |
|
105 | 105 | label_overview_text.text = "Successfully Authenticated!" |
106 | 106 | label_verification_url.text = ( |
|
0 commit comments