From 738a52a3bcfd14e0943dc673b2af336b38de8b39 Mon Sep 17 00:00:00 2001 From: luoxueyi Date: Sat, 22 Oct 2022 16:04:37 +0800 Subject: [PATCH] changlog --- backend/SystemUpdater/Core/Database.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/backend/SystemUpdater/Core/Database.py b/backend/SystemUpdater/Core/Database.py index ed697c9..5ef5f87 100644 --- a/backend/SystemUpdater/Core/Database.py +++ b/backend/SystemUpdater/Core/Database.py @@ -256,6 +256,13 @@ class Sqlite3Server(object): #FIXME: 临时方案 PHP PHPSeverSend(_appname=pkgname, _appversion=pkgversion, _statue=status, _errorcode="10000100", _errorstring=errstr) + file_path = os.path.join(get_config_patch(), str(pkgname) + ".yaml") + with open(file_path, "r") as stream: + try: + data_yaml = yaml.safe_load(stream) + changeLog = data_yaml['changelog'] + except yaml.YAMLError as exc: + logging.error(exc) elif pkg_list: changeLog = " " # 单包更新 # 获取单包数据插入数据库 @@ -388,7 +395,13 @@ class Sqlite3Server(object): #FIXME: 临时方案 PHP PHPSeverSend(_appname=i, _appversion=pkgversion, _statue=status, _errorcode="10000100", _errorstring=errstr) - + file_path = os.path.join(get_config_patch(), str(pkgname) + ".yaml") + with open(file_path, "r") as stream: + try: + data_yaml = yaml.safe_load(stream) + changeLog = data_yaml['changelog'] + except yaml.YAMLError as exc: + logging.error(exc) try: self.insert_into_updateinfo(str(i), pkgversion, pkgdescription, timestr, status, "1", errstr, appname_cn, status_cn, changeLog) self.window_main.dbusController.UpdateSqlitSingle(str(i), timestr)