You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Move to mpk format, add icon for LVGLTest, add more apps to appstore
This commit is contained in:
@@ -3,3 +3,5 @@ output/
|
||||
notes.txt
|
||||
|
||||
trash/
|
||||
|
||||
appstore_backend/bundled_apps/
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
[
|
||||
{
|
||||
"name": "Camera Tester",
|
||||
"publisher": "ACME Inc",
|
||||
"short_description": "Simple test of the camera",
|
||||
"long_description": "A simple test of the camera makes it possible to validate the hardware.",
|
||||
"icon_url": "http://demo.lnpiggy.com:2121/apps/com.example.camtest_0.0.1.mpk_icon_64x64.png",
|
||||
"download_url": "http://demo.lnpiggy.com:2121/apps/com.example.camtest_0.0.1.mpk",
|
||||
"fullname": "com.example.camtest",
|
||||
"version": "0.0.1"
|
||||
},
|
||||
{
|
||||
"name": "IMU Tester",
|
||||
"publisher": "ACME Inc",
|
||||
"short_description": "Testing the Inertial Measurement Unit",
|
||||
"long_description": "It is always good to make sure the accelerometer is working properly. How else can you measure acceleration and position?",
|
||||
"icon_url": "http://demo.lnpiggy.com:2121/apps/com.example.imutest_0.0.1.mpk_icon_64x64.png",
|
||||
"download_url": "http://demo.lnpiggy.com:2121/apps/com.example.imutest_0.0.1.mpk",
|
||||
"fullname": "com.example.imutest",
|
||||
"version": "0.0.1"
|
||||
},
|
||||
{
|
||||
"name": "Animation Tester",
|
||||
"publisher": "ACME Inc",
|
||||
"short_description": "Testing on-display animations",
|
||||
"long_description": "Stress testing multiple concurrent animations on the display by adding more and more spinners",
|
||||
"icon_url": "http://demo.lnpiggy.com:2121/apps/com.example.lvgltest_0.0.1.mpk_icon_64x64.png",
|
||||
"download_url": "http://demo.lnpiggy.com:2121/apps/com.example.lvgltest_0.0.1.mpk",
|
||||
"fullname": "com.example.imutest",
|
||||
"version": "0.0.1"
|
||||
},
|
||||
{
|
||||
"name": "Weather Pro",
|
||||
"publisher": "SkyTech",
|
||||
@@ -10,23 +40,23 @@
|
||||
"version": "0.0.1"
|
||||
},
|
||||
{
|
||||
"name": "Task Manager",
|
||||
"name": "Task Manager (broken download link)",
|
||||
"publisher": "Productivity Inc.",
|
||||
"short_description": "Organize your tasks",
|
||||
"long_description": "Task Manager helps you stay organized with customizable to-do lists, reminders, and progress tracking for personal and team projects.",
|
||||
"icon_url": "http://demo.lnpiggy.com:2121/icons/task_manager.png",
|
||||
"download_url": "http://demo.lnpiggy.com:2121/zips/com.example.app2_0.0.1.zip",
|
||||
"fullname": "com_example_app2",
|
||||
"download_url": "httpppp://completelybrokendownloadlink",
|
||||
"fullname": "com.productivityinc.taskmanager",
|
||||
"version": "0.0.1"
|
||||
},
|
||||
{
|
||||
"name": "Fitness Tracker",
|
||||
"name": "Fitness Tracker (broken icon)",
|
||||
"publisher": "HealthCo",
|
||||
"short_description": "Track your workouts",
|
||||
"long_description": "Fitness Tracker monitors your daily activities, workouts, and sleep patterns, offering personalized insights to help you achieve your fitness goals.",
|
||||
"icon_url": "http://demo.lnpiggy.com:2121/icons/fitness_tracker.png",
|
||||
"icon_url": "httppp://completelybrokeniconurl",
|
||||
"download_url": "http://demo.lnpiggy.com:2121/zips/com.example.imutest_0.0.1.zip",
|
||||
"fullname": "com_example_imutest",
|
||||
"fullname": "com.healthco.fitnesstracker",
|
||||
"version": "0.0.1"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
ls -1 internal_filesystem/apps | while read appdir; do
|
||||
echo "$appdir"
|
||||
pushd internal_filesystem/apps/"$appdir"
|
||||
zip -r0 ../../../bundled_apps/"$appdir"_0.0.1.zip .
|
||||
popd
|
||||
done
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
@@ -94,8 +94,8 @@ def download_and_unzip(zip_url, dest_folder, label):
|
||||
progress_bar.set_value(20, lv.ANIM.ON)
|
||||
time.sleep_ms(500)
|
||||
try:
|
||||
# Step 1: Download the .zip file
|
||||
print(f"Downloading .zip file from: {zip_url}")
|
||||
# Step 1: Download the .mpk file
|
||||
print(f"Downloading .mpk file from: {zip_url}")
|
||||
response = urequests.get(zip_url, timeout=10)
|
||||
if response.status_code != 200:
|
||||
print("Download failed: Status code", response.status_code)
|
||||
@@ -103,7 +103,7 @@ def download_and_unzip(zip_url, dest_folder, label):
|
||||
label.set_text(action_label_install)
|
||||
progress_bar.set_value(40, lv.ANIM.ON)
|
||||
time.sleep_ms(500)
|
||||
# Save the .zip file to a temporary location
|
||||
# Save the .mpk file to a temporary location
|
||||
try:
|
||||
os.remove(temp_zip_path)
|
||||
except Exception:
|
||||
@@ -112,15 +112,15 @@ def download_and_unzip(zip_url, dest_folder, label):
|
||||
os.mkdir("/tmp")
|
||||
except Exception:
|
||||
pass
|
||||
temp_zip_path = "/tmp/temp.zip"
|
||||
print(f"Writing to temporary zip path: {temp_zip_path}")
|
||||
temp_zip_path = "/tmp/temp.mpk"
|
||||
print(f"Writing to temporary mpk path: {temp_zip_path}")
|
||||
# TODO: check free available space first!
|
||||
with open(temp_zip_path, "wb") as f:
|
||||
f.write(response.content)
|
||||
progress_bar.set_value(60, lv.ANIM.ON)
|
||||
time.sleep_ms(500)
|
||||
response.close()
|
||||
print("Downloaded .zip file, size:", os.stat(temp_zip_path)[6], "bytes")
|
||||
print("Downloaded .mpk file, size:", os.stat(temp_zip_path)[6], "bytes")
|
||||
# Step 2: Unzip the file
|
||||
if zipfile is None:
|
||||
print("WARNING: zipfile module not available in this MicroPython build, unzip will fail!")
|
||||
@@ -132,7 +132,7 @@ def download_and_unzip(zip_url, dest_folder, label):
|
||||
print("Unzipped successfully")
|
||||
# Step 3: Clean up
|
||||
os.remove(temp_zip_path)
|
||||
print("Removed temporary .zip file")
|
||||
print("Removed temporary .mpk file")
|
||||
except Exception as e:
|
||||
print("Operation failed:", str(e))
|
||||
finally:
|
||||
|
||||
Binary file not shown.
Executable
+10
@@ -0,0 +1,10 @@
|
||||
mkdir -p appstore_backend/bundled_apps
|
||||
ls -1 internal_filesystem/apps | while read appdir; do
|
||||
echo "Bundling $appdir"
|
||||
pushd internal_filesystem/apps/"$appdir"
|
||||
# TODO: get and append version from manifest instead of hardcoding:
|
||||
mpkname="../../../appstore_backend/bundled_apps/"$appdir"_0.0.1.mpk"
|
||||
zip -r0 "$mpkname" .
|
||||
cp res/mipmap-mdpi/icon_64x64.png "$mpkname"_icon_64x64.png
|
||||
popd
|
||||
done
|
||||
Reference in New Issue
Block a user