Skip to content

Commit

Permalink
Merge pull request #256 from francisduvivier/bugfix/app-installation-…
Browse files Browse the repository at this point in the history
…not-working-on-sha2017

Bugfix/app installation not working on sha2017
  • Loading branch information
renzenicolai authored Feb 14, 2024
2 parents 04282f7 + e0bf2ee commit 605b850
Show file tree
Hide file tree
Showing 41 changed files with 108 additions and 96 deletions.
4 changes: 2 additions & 2 deletions firmware/configs/brucon2018_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ CONFIG_INFO_FIRMWARE_BUILD=19120801
CONFIG_INFO_HARDWARE_NAME="Generic ESP32"
CONFIG_INFO_HARDWARE_FOLDER="generic"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="generic"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/generic.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/generic.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/brucon2019_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ CONFIG_INFO_FIRMWARE_BUILD=2019091401
CONFIG_INFO_HARDWARE_NAME="ESP32"
CONFIG_INFO_HARDWARE_FOLDER="generic"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="generic"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/generic.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/generic.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/disobey2019_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ CONFIG_INFO_FIRMWARE_BUILD=21081401
CONFIG_INFO_HARDWARE_NAME="Disobey 2019"
CONFIG_INFO_HARDWARE_FOLDER="disobey2019"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="disobey2019"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/disobey2019.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/disobey2019.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/flipdotter_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ CONFIG_INFO_FIRMWARE_BUILD=20041001
CONFIG_INFO_HARDWARE_NAME="FlipDot"
CONFIG_INFO_HARDWARE_FOLDER="flipdotter"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="flipdotter"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/flipdotter.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/flipdotter.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/fri3d2018_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ CONFIG_INFO_FIRMWARE_BUILD=2019091401
CONFIG_INFO_HARDWARE_NAME="Fri3d camp 2018"
CONFIG_INFO_HARDWARE_FOLDER="fri3d2018"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="fri3d2018"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/fri3d2018.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/fri3d2018.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/generic_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ CONFIG_INFO_FIRMWARE_BUILD=19120801
CONFIG_INFO_HARDWARE_NAME="Generic ESP32"
CONFIG_INFO_HARDWARE_FOLDER="generic"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="generic"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/generic.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/generic.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/hsnl_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ CONFIG_INFO_FIRMWARE_BUILD=20011101
CONFIG_INFO_HARDWARE_NAME="HSNL"
CONFIG_INFO_HARDWARE_FOLDER="hsnl"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="generic"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/hsnl.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/hsnl.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/m5stack_atom_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ CONFIG_INFO_FIRMWARE_BUILD=20041701
CONFIG_INFO_HARDWARE_NAME="M5STACK ATOM Matrix"
CONFIG_INFO_HARDWARE_FOLDER="m5stack_atom"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="m5stack_atom"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/m5stack_atom.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/m5stack_atom.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/odroidgo_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ CONFIG_INFO_FIRMWARE_BUILD=0
CONFIG_INFO_HARDWARE_NAME="ODROID Go"
CONFIG_INFO_HARDWARE_FOLDER="generic"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="generic"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/odroidgo.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/odroidgo.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/ohs2018_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ CONFIG_INFO_FIRMWARE_BUILD=2019091401
CONFIG_INFO_HARDWARE_NAME="OHS2018"
CONFIG_INFO_HARDWARE_FOLDER="ohs2018"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="ohs2018"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/ohs2018.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/ohs2018.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/openaars_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ CONFIG_INFO_FIRMWARE_BUILD=19121401
CONFIG_INFO_HARDWARE_NAME="OpenAARS"
CONFIG_INFO_HARDWARE_FOLDER="openaars"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="generic"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/openaars.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/openaars.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/renze_nfc_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ CONFIG_INFO_FIRMWARE_BUILD=2019091401
CONFIG_INFO_HARDWARE_NAME="ESP32"
CONFIG_INFO_HARDWARE_FOLDER="renze_nfc"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="generic"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/generic.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/generic.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/t8_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ CONFIG_INFO_FIRMWARE_BUILD=19120801
CONFIG_INFO_HARDWARE_NAME="Generic ESP32"
CONFIG_INFO_HARDWARE_FOLDER="generic"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="generic"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/generic.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/generic.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/troopers2019_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ CONFIG_INFO_FIRMWARE_BUILD=2019091401
CONFIG_INFO_HARDWARE_NAME="Troopers 2019"
CONFIG_INFO_HARDWARE_FOLDER="troopers2019"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="troopers2019"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/troopers2019.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/troopers2019.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/ttgo_lora_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ CONFIG_INFO_FIRMWARE_BUILD=2019091401
CONFIG_INFO_HARDWARE_NAME="TTGO LoRa"
CONFIG_INFO_HARDWARE_FOLDER="generic"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="generic"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/ttgo-lora.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/ttgo-lora.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/ttgo_t4_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ CONFIG_INFO_FIRMWARE_BUILD=19101901
CONFIG_INFO_HARDWARE_NAME="ESP32"
CONFIG_INFO_HARDWARE_FOLDER="ttgo-t4"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="TTGO T4"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/ttgo-t4.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/ttgo-t4.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/ttgo_tm_music_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ CONFIG_INFO_FIRMWARE_BUILD=2019091401
CONFIG_INFO_HARDWARE_NAME="ESP32"
CONFIG_INFO_HARDWARE_FOLDER="generic"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="generic"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/generic.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/generic.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
4 changes: 2 additions & 2 deletions firmware/configs/wrover_kit_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ CONFIG_INFO_FIRMWARE_BUILD=2019091401
CONFIG_INFO_HARDWARE_NAME="Wrover kit"
CONFIG_INFO_HARDWARE_FOLDER="generic"
CONFIG_INFO_HARDWARE_WOEZEL_NAME="generic"
CONFIG_OTA_WEB_SERVER="badge.team"
CONFIG_OTA_WEB_SERVER="ota.badge.team"
CONFIG_OTA_WEB_USE_HTTPS=y
CONFIG_OTA_WEB_PORT=443
CONFIG_OTA_WEB_PATH="/firmware/wrover_kit.bin"
CONFIG_OTA_WEB_VERSION_PATH="/firmware/version/wrover_kit.txt"
CONFIG_WOEZEL_WEB_SERVER="badge.team"
CONFIG_WOEZEL_WEB_SERVER="hatchery.badge.team"
CONFIG_WIFI_SSID="badge"
CONFIG_WIFI_PASSWORD=""
CONFIG_DEFAULT_DISPLAY_ORIENTATION_LANDSCAPE=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def update():
return False
_showProgress("Downloading categories...")
try:
request = urequests.get("https://badge.team/eggs/categories/json", timeout=30)
request = urequests.get("https://%s/eggs/categories/json" % consts.WOEZEL_WEB_SERVER, timeout=30)
_showProgress("Saving categories...")
categories_file = open(path+'/categories.json', 'w')
categories_file.write(request.text)
Expand All @@ -44,7 +44,7 @@ def update():
gc.collect()
slug = category["slug"]
_showProgress("Downloading '"+category["name"]+"'...")
f = urequests.get("https://badge.team/basket/"+consts.INFO_HARDWARE_WOEZEL_NAME+"/category/%s/json" % slug, timeout=30)
f = urequests.get("https://%s/basket/%s/category/%s/json" % (consts.WOEZEL_WEB_SERVER, consts.INFO_HARDWARE_WOEZEL_NAME, slug), timeout=30)
f_file = open(path+'/'+slug+'.json', 'w')
f_file.write(f.text)
f_file.close()
Expand Down
8 changes: 5 additions & 3 deletions firmware/python_modules/flipdotter/woezel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import ujson as json
import uzlib
import upip_utarfile as tarfile
import consts

gc.collect()

debug = False
Expand Down Expand Up @@ -147,21 +149,21 @@ def url_open(url):


def get_pkg_metadata(name):
f = url_open("https://badge.team/eggs/get/%s/json" % name)
f = url_open("https://%s/eggs/get/%s/json" % (consts.WOEZEL_WEB_SERVER, name))
try:
return json.load(f)
finally:
f.close()

def get_pkg_list():
f = url_open("https://badge.team/basket/hackerhotel2019/list/json")
f = url_open("https://%s/basket/hackerhotel2019/list/json" % (consts.WOEZEL_WEB_SERVER))
try:
return json.load(f)
finally:
f.close()

def search_pkg_list(query):
f = url_open("https://badge.team/basket/hackerhotel2019/search/%s/json" % query)
f = url_open("https://%s/basket/hackerhotel2019/search/%s/json" % (consts.WOEZEL_WEB_SERVER, query))
try:
return json.load(f)
finally:
Expand Down
9 changes: 6 additions & 3 deletions firmware/python_modules/fri3d2018/woezel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import ujson as json
import uzlib
import upip_utarfile as tarfile
import consts

gc.collect()

debug = False
Expand Down Expand Up @@ -146,22 +148,23 @@ def url_open(url):
return s



def get_pkg_metadata(name):
f = url_open("https://badge.team/eggs/get/%s/json" % name)
f = url_open("https://{}/eggs/get/{}/json".format(consts.WOEZEL_WEB_SERVER, name))
try:
return json.load(f)
finally:
f.close()

def get_pkg_list():
f = url_open("https://badge.team/basket/hackerhotel2019/list/json")
f = url_open("https://{}/basket/{}/list/json".format(consts.WOEZEL_WEB_SERVER, consts.INFO_HARDWARE_WOEZEL_NAME))
try:
return json.load(f)
finally:
f.close()

def search_pkg_list(query):
f = url_open("https://badge.team/basket/hackerhotel2019/search/%s/json" % query)
f = url_open("https://{}/basket/{}/search/{}/json".format(consts.WOEZEL_WEB_SERVER, consts.INFO_HARDWARE_WOEZEL_NAME, query))
try:
return json.load(f)
finally:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def update():
return False
_showProgress("Downloading categories...")
try:
request = urequests.get("https://badge.team/eggs/categories/json", timeout=30)
request = urequests.get("https://%s/eggs/categories/json" % consts.WOEZEL_WEB_SERVER, timeout=30)
_showProgress("Saving categories...")
categories_file = open(path+'/categories.json', 'w')
categories_file.write(request.text)
Expand All @@ -44,7 +44,7 @@ def update():
gc.collect()
slug = category["slug"]
_showProgress("Downloading '"+category["name"]+"'...")
f = urequests.get("https://badge.team/basket/"+consts.INFO_HARDWARE_WOEZEL_NAME+"/category/%s/json" % slug, timeout=30)
f = urequests.get("https://%s/basket/%s/category/%s/json" % (consts.WOEZEL_WEB_SERVER, consts.INFO_HARDWARE_WOEZEL_NAME, slug), timeout=30)
f_file = open(path+'/'+slug+'.json', 'w')
f_file.write(f.text)
f_file.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def update():
return False
_showProgress("Downloading categories...")
try:
request = urequests.get("https://badge.team/eggs/categories/json", timeout=30)
request = urequests.get("https://%s/eggs/categories/json" % consts.WOEZEL_WEB_SERVER, timeout=30)
_showProgress("Saving categories...")
categories_file = open(path+'/categories.json', 'w')
categories_file.write(request.text)
Expand All @@ -44,7 +44,7 @@ def update():
gc.collect()
slug = category["slug"]
_showProgress("Downloading '"+category["name"]+"'...")
f = urequests.get("https://badge.team/basket/"+consts.INFO_HARDWARE_WOEZEL_NAME+"/category/%s/json" % slug, timeout=30)
f = urequests.get("https://%s/basket/%s/category/%s/json" % (consts.WOEZEL_WEB_SERVER, consts.INFO_HARDWARE_WOEZEL_NAME, slug), timeout=30)
f_file = open(path+'/'+slug+'.json', 'w')
f_file.write(f.text)
f_file.close()
Expand Down
Loading

0 comments on commit 605b850

Please sign in to comment.