小应用管理,运行于 pyChariot 之上小应用的管理与操作
getDirAppchip(appchip_id) {#getDirAppchip}
获取指定小应用的程序目录
参数
类型
说明
appchip_id
string
小应用标识,默认为当前小应用
await __A . appchip . getDirAppchip ( ) ;
getDirTemp(appchip_id) {#getDirTemp}
获取指定小应用的临时目录
参数
类型
说明
appchip_id
string
小应用标识,默认为当前小应用
await __A . appchip . getDirTemp ( ) ;
getDirData(appchip_id) {#getDirData}
获取指定小应用的数据目录
参数
类型
说明
appchip_id
string
小应用标识,默认为当前小应用
await __A . appchip . getDirData ( ) ;
getDirWebview(appchip_id) {#getDirWebview}
获取指定小应用的浏览器控件的数据目录
参数
类型
说明
appchip_id
string
小应用标识,默认为当前小应用
await __A . appchip . getDirWebview ( ) ;
::: warning 已废弃,将在后继版本中删除。
:::
获取所有小应用的名称列表
await __A . appchip . list ( ) ;
获取所有小应用的详细信息
返回的对方包含以小应用标识为名称的属性,属性的值为对应小应用的详细信息。
await __A . appchip . list ( ) ;
运行指定的小应用
参数
类型
说明
id
string
小应用标识
params
string
命令行参数,可忽略。
await __A . appchip . run ( 'calc' ) ;
runWait(id, params) {#runWait}
运行指定的可执行文件,并等待其运行完毕。 运行完毕后,返回运行结果信息。
参数
类型
说明
id
string
小应用标识
params
string
命令行参数,可忽略。
返回对象,描述进程的运行情况,包括以下属性:
retcode: 进程返回值;
stdout: 标准输出;
stderr: 标准错误;
await __A . appchip . runWait ( 'calc' ) ;
installFromUrl(url) {#installFromUrl}
从指定的网址下载安装小应用
参数
类型
说明
url
string
小应用安装网址
await __A . appchip . installFromUrl ( 'http://localhost/calc.zip' ) ;
uninstall(appchip_id, purge) {#uninstall}
卸载指定的小应用,如果 purge 为 false,仅删除程序包,保留相关数据文件。
参数
类型
说明
url
string
小应用安装网址
purge
bool
是否完全删除,默认为 true
await __A . appchip . uninstall ( 'calc' ) ;