Merge branch 'dev' of ssh://172.17.66.163:10022/wangsong/kylin-system-updater into dev
This commit is contained in:
commit
14c69c923a
|
@ -4,6 +4,7 @@ __pycache__
|
|||
|
||||
.vscode
|
||||
.pybuild
|
||||
build
|
||||
|
||||
# Misc
|
||||
.*cache
|
||||
|
|
|
@ -18,12 +18,12 @@ class Sqlite3Server(object):
|
|||
def __init__(self, window_main):
|
||||
self.connect = None
|
||||
self.window_main = window_main
|
||||
logging.info("init Sqlite3Server running...")
|
||||
logging.info("Init Sqlite3Server...")
|
||||
self.init_sqlit()
|
||||
|
||||
# 初始化连接数据库
|
||||
def init_sqlit(self):
|
||||
logging.info(_("初始化连接数据库 ..."))
|
||||
logging.info(_("Initialize the connection to the database ..."))
|
||||
try:
|
||||
if os.path.isfile(DB_FILE):
|
||||
self.connect = sqlite3.connect(DB_FILE, check_same_thread=False)
|
||||
|
@ -37,9 +37,9 @@ class Sqlite3Server(object):
|
|||
self.cursor = self.connect.cursor()
|
||||
self.insert_new_field()
|
||||
except Exception as e:
|
||||
logging.error(_("初始化数据库失败: %s"), str(e))
|
||||
logging.error(_("Failed to initialize the database: %s"), str(e))
|
||||
return False
|
||||
logging.info(_("成功连接数据库."))
|
||||
logging.info(_("Connecting to the database successfully."))
|
||||
return True
|
||||
|
||||
# 数据库表格中动态增加新的字段用于扩展
|
||||
|
@ -62,9 +62,9 @@ class Sqlite3Server(object):
|
|||
else:
|
||||
sql = 'alter table installed add column "' + value["item"] + '" ' + value["type"]
|
||||
self.cursor.execute(sql)
|
||||
logging.info(_("installed表插入新字段: %s"), value["item"])
|
||||
logging.info(_("installed table insert new field: %s"), value["item"])
|
||||
except:
|
||||
logging.error(_("installed表插入新字段失败:"), value["item"], exc_info=True)
|
||||
logging.error(_("installed table failed to insert a new field:"), value["item"], exc_info=True)
|
||||
|
||||
self.cursor.execute("select sql from sqlite_master where name='display'")
|
||||
display_sql = self.cursor.fetchone()[0]
|
||||
|
@ -82,9 +82,9 @@ class Sqlite3Server(object):
|
|||
else:
|
||||
sql = 'alter table installed add column "' + value["item"] + '" ' + value["type"]
|
||||
self.cursor.execute(sql)
|
||||
logging.info(_("display表插入新字段: %s"), value["item"])
|
||||
logging.info(_("display table insert new field: %s"), value["item"])
|
||||
except:
|
||||
logging.error(_("display表插入新字段失败: %s"), value["item"], exc_info=True)
|
||||
logging.error(_("display table failed to insert a new field: %s"), value["item"], exc_info=True)
|
||||
|
||||
# 写入数据到installed表中
|
||||
def insert_into_installed(self, *args, **kwargs):
|
||||
|
@ -102,13 +102,13 @@ class Sqlite3Server(object):
|
|||
|
||||
# 写入updateinfo表中
|
||||
def insert_into_updateinfo(self, *args, **kwargs):
|
||||
logging.info(_("正在插入数据库... "))
|
||||
logging.info(_("Inserting data into the database... "))
|
||||
self.cursor.execute(
|
||||
"insert into updateinfos (update_lists, date, status, keyword, errorcode) values(?,"
|
||||
"?,?,?,?)",
|
||||
(args[0], args[1], args[2], args[3], args[4]))
|
||||
self.connect.commit()
|
||||
logging.info(_("加入数据库完成"))
|
||||
logging.info(_("Data insertion complete ."))
|
||||
|
||||
# 接收更新列表与信息,生成数据并插入数据库中
|
||||
def insert_info(self, lists, success, error_string, error_desc):
|
||||
|
@ -130,7 +130,7 @@ class Sqlite3Server(object):
|
|||
try:
|
||||
pkg = self.window_main.cache[i]
|
||||
except Exception as e:
|
||||
logging.error("由于源被更改或其它原因,导致 %s 无法在源中检测到.", str(i))
|
||||
logging.error(_("%s could not be detected in the source because the source was changed or for other reasons."), str(i))
|
||||
# candidate = self._depcache.get_candidate_ver(pkg)
|
||||
candidate = pkg.candidate.version
|
||||
app_info['version'] = str(candidate)
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
kylin-system-updater (1.1.1kord) v101; urgency=medium
|
||||
|
||||
* add database .
|
||||
|
||||
-- luoxueyi <luoxueyi@kylinos.cn> Tue, 28 Sep 2021 20:38:29 +0800
|
||||
|
||||
kylin-system-updater (1.0.4kord) v101; urgency=medium
|
||||
|
||||
* 重新编包,修复依赖,去除无用文件, 修改版本号
|
||||
|
|
Loading…
Reference in New Issue