更新构建脚本 & 关于页

This commit is contained in:
Jiting 2019-02-07 16:11:41 +08:00
parent 68535b4483
commit 117d345239
No known key found for this signature in database
GPG Key ID: B68ED772995769D6
3 changed files with 37 additions and 19 deletions

View File

@ -3,21 +3,25 @@ language: python
python: 3.7
sudo: required
cache:
- bundler
- pip
branches:
except:
- travis-dev-build
before_install:
- export TZ=Asia/Shanghai
- mkdir dist -p
- sudo apt-get update -q
- export TZ=Asia/Shanghai
- mkdir dist -p
- sudo apt-get update -q
install:
- sudo apt-get install qt5-default qttools5-dev-tools -y -q
- sudo apt-get install qt5-default qttools5-dev-tools -y -q
script:
- python3 maker.py
- rm dist/*
- python3 maker.py
- rm dist/*
before_deploy:
- git tag -f travis-dev-build
@ -40,4 +44,7 @@ deploy:
overwrite: true
target_commitish: $TRAVIS_COMMIT
on:
repo: jitingcn/TS3-Translation_zh-CN
repo: jitingcn/TS3-Translation_zh-CN
after_deploy:
- python3 maker.py 1

View File

@ -55,15 +55,22 @@ def make_release():
def send_progress(done, total):
percentage = round(done*100/total, 2)
output = f"测试推送:当前进度:\n{done}/{total}\n{percentage}%"
print(output)
try:
telegram_push(output)
print("\n推送完毕\n")
except Exception as err:
print(f"\n{err}\n推送失败\n")
def telegram_push(string):
querystring = parse.urlencode({"text": string.encode('utf-8')})
tg_api = os.getenv('TG_API')
group_id = os.getenv('TG_GROUP_ID')
url = f"https://api.telegram.org/bot{tg_api}/sendMessage?chat_id={group_id}&"
percentage = round(done*100/total, 2)
output = f"当前进度:\n{done}/{total}\n{percentage}%".encode("utf-8")
querystring = parse.urlencode({"text": output})
request.urlopen(url + querystring)
print(output.decode("utf-8"))
print("进度消息推送完毕\n")
def make_package(release_list):
@ -72,7 +79,7 @@ def make_package(release_list):
with open(ini, "w", encoding="utf-8") as f:
package_info = [f"Name = TeamSpeak 3 简体中文汉化包 软件版本:{target_version}",
"Type = Translation",
"Author = 寂听",
"Author = 寂听 & EdisonJwa",
f"Version = {timestamp}",
"Platforms = ",
'Description = 源代码: https://github.com/jitingcn/TS3-Translation_zh-CN']
@ -84,11 +91,15 @@ def make_package(release_list):
release.write(ini, "package.ini")
for i in release_list:
release.write(dist+i, f"translations/{i}")
print("Complete.")
print("构建成功")
if __name__ == '__main__':
print("Making .qm translations file ...")
release_file_list = make_release()
print("Making .ts3_translation release package ...")
make_package(release_file_list)
if len(sys.argv) <= 1:
print("Making .qm translations file ...")
release_file_list = make_release()
print("Making .ts3_translation release package ...")
make_package(release_file_list)
else:
if sys.argv[1] == "1":
telegram_push("部署成功")

View File

@ -22,7 +22,7 @@
<message>
<source>PLACEHOLDER</source>
<extracomment>Translators can add their names, copyright notice or links here. If the text stays &quot;PLACEHOLDER&quot;, the label will be hidden.</extracomment>
<translation>&lt;b&gt; By:&lt;/b&gt; &lt;a href=&quot;http://blog.jtcat.com&quot;&gt;&lt;/a&gt;&lt;br&gt;由于本人水平有限,欢迎到&lt;a href=&quot;https://github.com/jitingcn/TS3-Translation_zh-CN&quot;&gt;GitHub项目主页&lt;/a&gt;&lt;br&gt;</translation>
<translation type="unfinished">&lt;b&gt; By:&lt;/b&gt; &lt;a href=&quot;http://blog.jtcat.com/&quot;&gt;&lt;/a&gt; &amp; &lt;a href=&quot;https://www.wevg.org/&quot;&gt;EdisonJwa&lt;/a&gt;&lt;br&gt;如有任何疑问,欢迎到&lt;a href=&quot;https://github.com/jitingcn/TS3-Translation_zh-CN&quot;&gt;GitHub项目主页&lt;/a&gt;&lt;br&gt;</translation>
</message>
<message>
<source>Copyright</source>