1 Star 1 Fork 104

海石生风 / QVirtualKeyboard

forked from 风刮过冷 / QVirtualKeyboard 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
update-changelog 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
ChenShiSheng 提交于 2023-11-23 15:03 . 优化键盘的显示与隐藏;
#!/usr/bin/python
import sys
import os
import time
log_fmt = '''{app} ({version}) stable; urgency=medium
{changes}
-- Chenss <chenshisheng@reliachina.com> {time}
'''
def lastLogInfo():
appName = ""
mainVersion = ""
lastStr = ""
with open("debian/changelog") as changelog:
line = changelog.readline()
if len(line) == 0:
return ""
syms = line.split(' ')
appName = syms[0]
verInfo = syms[1]
lastStr = verInfo[1:-1]
if '-' in lastStr:
mainVersion = lastStr.split('-')[0]
else:
mainVersion = lastStr
return appName, mainVersion
if __name__ == "__main__":
app, lastMainVer = lastLogInfo()
vp1, vp2, vp3 = lastMainVer.split('.')
version = "{}.{}.{}-1".format(vp1, vp2, int(vp3) + 1)
print("last version: {}.{}.{}".format(vp1, vp2, vp3))
print("current version: {}".format(version))
changes = ""
with open(".git/COMMIT_EDITMSG", 'r') as msg:
for line in msg.readlines():
if len(line) == 0 or line.isspace() or line.startswith('#'):
continue
changes += " * {}".format(line)
# print(changes)
lt = time.localtime()
timeInfo = time.strftime("%a, %d %b %Y %H:%M:%S %z", lt)
log = log_fmt.format(app=app, version=version, changes=changes, time=timeInfo)
print("update changelog")
# print(log)
with open("debian/changelog", 'r+') as changelog:
logs = changelog.readlines()
logs.insert(0, log)
changelog.seek(0)
changelog.writelines(logs)
os.system("git commit -a --amend")
C/C++
1
https://gitee.com/ufbycd/QVirtualKeyboard.git
git@gitee.com:ufbycd/QVirtualKeyboard.git
ufbycd
QVirtualKeyboard
QVirtualKeyboard
master

搜索帮助