From d0a133c978fd8403b708ffe0ad5dbc1a60d4a8d2 Mon Sep 17 00:00:00 2001 From: Marek Ventur Date: Mon, 27 Aug 2018 17:25:54 +0100 Subject: [PATCH] Add sponsors app --- sponsors/main.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sponsors/main.py diff --git a/sponsors/main.py b/sponsors/main.py new file mode 100644 index 0000000..082f2e9 --- /dev/null +++ b/sponsors/main.py @@ -0,0 +1,26 @@ +"""A big "thank you" to all our Sponsors who made this year's badge possible!""" + +___name___ = "Sponsors" +___license___ = "MIT" +___dependencies___ = ["wifi", "http", "ugfx_helper"] +___categories___ = ["EMF"] +___bootstrapped___ = True + +import ugfx_helper, os, wifi, ugfx, http, time +from tilda import Buttons + +ugfx_helper.init() +ugfx.clear() + +ugfx.text(5, 5, "Loading...", ugfx.BLACK) +try: + image = http.get("http://s3.amazonaws.com/tilda-badge/sponsors/screen.png").raise_for_status().content + ugfx.display_image(0,0,bytearray(image)) +except: + ugfx.clear() + ugfx.text(5, 5, "Couldn't download sponsors", ugfx.BLACK) + +while (not Buttons.is_pressed(Buttons.BTN_A)) and (not Buttons.is_pressed(Buttons.BTN_B)) and (not Buttons.is_pressed(Buttons.BTN_Menu)): + time.sleep(0.01) + +ugfx.clear()