完善接口文档
This commit is contained in:
parent
43a590a622
commit
34bed1c8d2
|
@ -251,7 +251,15 @@ class UpdateList():
|
|||
WHITE_LIST_PATH = '/tmp/example.conf'
|
||||
config = configparser.ConfigParser()
|
||||
pkgs_install,pkgs_upgrade = self._make_pkgs_list(cache,upgrade_data.upgrade_groups_pkgs,upgrade_data.upgrade_groups,upgrade_data.single_pkgs)
|
||||
config['WHITELIST'] = {"upgrade_list":pkgs_upgrade,"install_list":pkgs_install}
|
||||
|
||||
pkgs_upgrade_str = ''
|
||||
if pkgs_upgrade:
|
||||
for pkg_str in pkgs_upgrade:
|
||||
pkgs_upgrade_str += (pkg_str + ',')
|
||||
|
||||
pkgs_upgrade_str=pkgs_upgrade_str[:-1]
|
||||
|
||||
config['WHITELIST'] = {"upgrade_list":pkgs_upgrade_str}
|
||||
with open(WHITE_LIST_PATH, 'w') as configfile:
|
||||
config.write(configfile)
|
||||
logging.info("Generate Configfile(%s) to complete...",WHITE_LIST_PATH)
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
|
||||
|
||||
### Method
|
||||
|
||||
#### 方法列表
|
||||
|
||||
### 方法列表
|
||||
|
||||
| Method Name | Input Args | Output Args | means |
|
||||
| ------------------ | ---------- | ----------- | --------------------------------- |
|
||||
|
@ -33,23 +33,57 @@
|
|||
| SetDownloadspeedMax | sb | b | 设置限速 |
|
||||
#### Method分析
|
||||
|
||||
#### UpdateDetect
|
||||
|
||||
- `简介:`更新cache对象,完成从之后拿到系统中所有可升级的包再经过源过滤、白名单等等的过滤,最后输出当前`可升级的包以及分组(JSON配置 输出目录: /var/lib/kylin-system-updater)
|
||||
|
||||
- `入参:`无
|
||||
- `出参:`True and False
|
||||
- `对应信号:`
|
||||
- `UpdateDetectStatusChanged:` 更新的进度信息和状态信息
|
||||
- `UpdateDetectFinished:`更新的完成的信号
|
||||
|
||||
|
||||
|
||||
#### DistUpgradeAll
|
||||
|
||||
- `简介:`升级全部可升级的分组
|
||||
|
||||
- `入参:` `b:` False模式:只进行获取升级列表以及计算修复依赖关系,以及计算是否存在删除的包,`True模式:`直接进行安装的操作 注意:必须选使用False模式获取升级列表以及计算依赖关系再进行True模式
|
||||
- `出参:`True and False
|
||||
- `对应信号:`
|
||||
- `UpdateDependResloveStatus:` 升级计算依赖修复反馈信号
|
||||
- `UpdateDloadAndInstStaChanged:`升级安装过程的进度信号以及状态
|
||||
- `UpdateInstallFinished:` 升级安装完成的信号
|
||||
|
||||
|
||||
|
||||
-
|
||||
|
||||
#### UpdateDownloadInfo
|
||||
|
||||
- `介绍:` 发送下载包信息信号
|
||||
|
||||
- `出参`: `i:`当前正在下载的项,`i:`所有下载的项,`i:`当前下载的字节,`i:`总的需要下载的字节,`i:`下载速度
|
||||
|
||||
- `示例:`
|
||||
|
||||
```sh
|
||||
current_items = 1, total_items = 1, currenty_bytes = 45 kB, total_bytes = 45 kB, current_cps = 0 kB/s
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### Signal列表
|
||||
|
||||
| Method Name | Output Args | means |
|
||||
| Signal Name | Output Args | means |
|
||||
| ---------------------------- | ----------- | ------------------------ |
|
||||
| UpdateDetectStatusChanged | i,s | 更新进度信息以及状态信息 |
|
||||
| UpdateDetectFinished | b,as,s,s | 更新完成信号 |
|
||||
| UpdateDloadAndInstStaChanged | as,i,s | 升级的进度信号以及状态 |
|
||||
| UpdateDloadAndInstStaChanged | as,i,s,s | 升级的进度信号以及状态 |
|
||||
| UpdateInstallFinished | b,as,s,s | 升级完成的信号 |
|
||||
| UpdateDownloadInfo | i,i,i,i,i | 发送下载包信息信号 |
|
||||
| UpdateDependResloveStatus | b,b,s | 更新依赖修复信息 |
|
||||
|
@ -61,19 +95,77 @@
|
|||
|
||||
#### Signal分析
|
||||
|
||||
##### update_progress_signal
|
||||
#### UpdateDetectStatusChanged
|
||||
|
||||
| method name | out args |
|
||||
| ---------------------- | -------------------------------------------- |
|
||||
| update_progress_signal | is |
|
||||
| 部分升级 | i:进度状态0-100,101为非预期状态 S:状态信息 |
|
||||
- `介绍:`更新的进度信息和状态信息
|
||||
|
||||
- `出参`:`i:`更新的进度信息从0-100%,`s:`更新的状态信息
|
||||
|
||||
- `示例:`
|
||||
|
||||
update_finished_signal
|
||||
```sh
|
||||
progress = 9 , status = 正在解决依赖关系
|
||||
progress = 92 , status = 正在载入软件列表
|
||||
progress = 92 , status = 完成
|
||||
```
|
||||
|
||||
| method name | out args |
|
||||
| ---------------------- | --------------------------------------------------- |
|
||||
| update_progress_signal | basss |
|
||||
| 部分升级 | b:成功或失败、as:可升级的组、s:错误结果、s:错误原因 |
|
||||
|
||||
|
||||
#### UpdateDetectFinished
|
||||
|
||||
- `介绍:`更新的完成的信号
|
||||
|
||||
- `出参`: `b:`更新是否成功,`as:`可升级的组列表,`s:`产生错误的结果,`s:`产生错误的原因
|
||||
|
||||
- `示例:`
|
||||
|
||||
```sh
|
||||
success = True , upgrade_group = ['kylin-update-desktop-system', 'tree', 'texinfo', 'kylin-update-manager', 'dnsmasq-base', 'vino', 'dpkg-dev', 'ghostscript', 'atril', 'wpasupplicant', 'eom', 'eom-common', 'fcitx-bin', 'fcitx-data', 'fcitx-frontend-gtk2', 'wps-office'], error_string = , error_desc =
|
||||
|
||||
error_string = 获取更新软件推送失败,请稍后再进行尝试更新 , error_desc = 推送服务器连接异常
|
||||
|
||||
```
|
||||
|
||||
#### UpdateDependResloveStatus
|
||||
|
||||
- `介绍:`升级计算依赖修复反馈信号
|
||||
|
||||
- `出参`: `b:`修复依赖关系是否成功,`b:`是否存在升级需要卸载的包,`as:`卸载的包列表,`as:`卸载的包的描述信息,`as:`卸载此包的原因 升级安装那些包导致的,`s:`产生错误的结果,`s:`产生错误的原因
|
||||
|
||||
- `示例:`
|
||||
|
||||
```sh
|
||||
UpdateDependResloveStatus:resolver_status = True , remove_status = True , remove_pkgs = ['kylin-burner-i18n'],pkg_raw_description = ['Sophisticated CD/DVD burning application - localizations files'] ,delete_desc = ['kylin-burner-i18n 将要被删除,由于升级 kylin-burner'],error_string = , error_desc =
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### UpdateDloadAndInstStaChanged
|
||||
|
||||
- `介绍:` 升级安装过程的进度信号以及状态
|
||||
|
||||
- `出参`: `as:`当前那些组在升级安装 `i:`更新的进度信息从0-100%,`s:`更新的状态信息 `s:`下载的细节信息
|
||||
|
||||
- ` 示例:`
|
||||
|
||||
```sh
|
||||
groups_list = ['kylin-update-desktop-system'] progress = 15 , status = 下载中 current_details = 下载中 tree
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### UpdateInstallFinished
|
||||
|
||||
- `介绍:` 升级安装完成的信号
|
||||
|
||||
- `出参`: `b:`更新是否成功,`as:`可升级的组列表,`s:`产生错误的结果,`s:`产生错误的原因
|
||||
|
||||
- `示例:`
|
||||
|
||||
```sh
|
||||
pdateInstallFinished success = True , upgrade_group = ['tree'], error_string = 系统升级完成。 , error_desc =
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue