|
31 | 31 | https = requests.Session(socket, ssl.create_default_context()) |
32 | 32 |
|
33 | 33 | # Paste your API token below |
34 | | -#TOKEN = "YOUR_API_TOKEN" |
35 | | -TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYwYTdlYmZiZjk2N2U2MDAxNzNmNWY0MCIsImlhdCI6MTYzMzM2NzM5NiwiZXhwIjoxNjQyMDA3Mzk2fQ.vJsMVR_b8QMl7APrqoEFNPXIq-jeLKXB8yUeQPIDK_o" # pylint: disable=line-too-long |
| 34 | +TOKEN = "YOUR_API_TOKEN" |
| 35 | + |
| 36 | + |
36 | 37 | def font_width_to_dict(font): |
37 | 38 | # Reads the font file to determine how wide each character is |
38 | 39 | # Used to avoid bad wrapping breaking the QR code |
@@ -87,7 +88,6 @@ def wrap(text, max_width, max_lines, font): |
87 | 88 | return "\n".join(lines[:max_lines]) |
88 | 89 |
|
89 | 90 |
|
90 | | - |
91 | 91 | # Get first 300 items, saving only the OSHWA UIDs. The first 300 are also used to find the |
92 | 92 | # number of requests that will need to be made. |
93 | 93 | # This was done this way since if the items themselves were all asked for and stored, the MagTag |
@@ -183,7 +183,7 @@ def wrap(text, max_width, max_lines, font): |
183 | 183 | magtag.set_text(wrap(selected["projectName"], 545, 2, arial_12), 0, False) |
184 | 184 | magtag.set_text(wrap(selected["projectDescription"], 530, 19, arial_9), 1) |
185 | 185 | magtag.exit_and_deep_sleep(3600) |
186 | | -except Exception: # pylint: disable=broad-except |
| 186 | +except Exception: # pylint: disable=broad-except |
187 | 187 | print("Could not set title or description: unsupported glyphs.") |
188 | 188 | print("Trying again in 10 seconds.") |
189 | 189 | magtag.exit_and_deep_sleep(10) |
0 commit comments