在Quarter OS中,提供了第三方软件包管理器 Biscuit
,它可以帮助用户轻松地安装、卸载第三方软件包。
Biscuit 软件包管理器支持的软件包类型为 .qap
。
QAP,全称为 Quarter OS Application Package,是一种适用于Biscuit Package Manager for Quarter OS的软件包格式。
QAP 软件包封装器位于 devtool
目录下,可以将Python程序打包为QAP软件包。
使用 zipfile
模块将所有程序文件压缩成 .zip
压缩包,并重命名为 packagename_version.qap
。
QAP_Package/
├── [主要文件] main.py
├── [主要文件] info.json
├── README.md
├── [其他文件]
└── ……
import requests
def get_data():
url = "https://example.com/api/data"
response = requests.get(url)
return response.json()
def main():
data = get_data()
print(data)
if __name__ == "__main__":
main()
{
"name": "your_package_name",
"version": "1.0",
"author": "your_name",
"description": "The description of your package",
"category": "tools",
"min_python_version": "3.10",
"target_python_version": "3.12",
"comptb_os": "windows",
"biscuit_version": "1.0",
"tags": [
"tools",
"python"
],
"depends": [
"requests"
]
}
TIP
当你使用 qap_maker.py
工具打包时,如果你还没准备好 info.json
文件,qap_maker.py
工具会帮助你在封装器中生成一个。
example
, my_package
, demo_package2
Tools
:工具类Games
:游戏类Amusement
:娱乐类Education
:教育类Others
:其他类#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@Name: your_package_name
@Version: 1.0
@Author: Your_Name
@Description: The description of your package.
"""
try:
# 你的程序代码
except KeyboardInterrupt:
print("Program terminated by user.")
exit()
except Exception as e:
print("An error occurred:", e)
exit()
测试版本命名规范:my_package_dev
, my_package_test
, my_package_beta
当前支持本地安装:biscuit install /path/to/your_package.qap