Skip to content

Commit

Permalink
Added common data
Browse files Browse the repository at this point in the history
  • Loading branch information
R-YaTian committed Dec 31, 2024
1 parent 0f15048 commit e972b0e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
submodules: recursive
- name: Make binary
run: |
zip TWLMagician-Python3-Linux.zip TWLMagician.py appgen.py requirements.txt pyutils.py
zip TWLMagician-Python3-Linux.zip TWLMagician.py appgen.py requirements.txt pyutils.py logo.png
zip -ur TWLMagician-Python3-Linux.zip Linux py_langs tk_tooltip i18n
- name: Publish artifact
uses: actions/upload-artifact@main
Expand Down
Binary file added Res/Common.dat
Binary file not shown.
Binary file removed Res/OTA.exe
Binary file not shown.
11 changes: 8 additions & 3 deletions TWLMagician.py
Original file line number Diff line number Diff line change
Expand Up @@ -2283,9 +2283,14 @@ def get_common_data(self):
try:
if not path.isfile('Common.dat'):
self.log.write(_('正在下载通用数据...'))
with urlopen('https://gitee.com/ryatian/mirrors/releases/download/Res/Common.dat'
) as src, open('Common.dat', 'wb') as dst:
copyfileobj(src, dst)
if loc == 'zh_cn' or (loca == 'zh_hans' and region == 'cn'):
with urlopen('https://gitee.com/ryatian/mirrors/releases/download/Res/Common.dat'
) as src, open('Common.dat', 'wb') as dst:
copyfileobj(src, dst)
else:
with urlopen('https://raw.githubusercontent.com/R-YaTian/TWLMagician/main/Res/Common.dat'
) as src, open('Common.dat', 'wb') as dst:
copyfileobj(src, dst)

if sysname == 'Linux' and ug is not None and su is True: # chown on Linux if with sudo
Popen(['chown', '-R', ug + ':' + ug, 'Common.dat']).wait()
Expand Down

0 comments on commit e972b0e

Please sign in to comment.