-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from muziing/dev
Version `0.3.1`
- Loading branch information
Showing
29 changed files
with
1,502 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
"""开发脚本,便于调用 PySide6 提供的各种工具程序 | ||
""" | ||
|
||
import subprocess | ||
|
||
from dev_scripts.path_constants import ( | ||
COMPILED_RESOURCES, | ||
PROJECT_ROOT, | ||
RESOURCES_PATH, | ||
SRC_PKG_PATH, | ||
WIDGETS_PATH, | ||
) | ||
|
||
|
||
def compile_resources() -> int: | ||
"""调用 RCC 工具编译静态资源 | ||
:return: rcc 进程返回码 | ||
""" | ||
|
||
compiled_file_path = COMPILED_RESOURCES | ||
qrc_file_path = RESOURCES_PATH / "resources.qrc" | ||
cmd = [ | ||
"pyside6-rcc", | ||
"-o", | ||
compiled_file_path, | ||
qrc_file_path, | ||
] | ||
|
||
try: | ||
result = subprocess.run(cmd, cwd=PROJECT_ROOT, check=True) | ||
except subprocess.SubprocessError as e: | ||
print(f"RCC 编译进程错误:{e}") | ||
raise e | ||
else: | ||
print(f"已完成静态资源文件编译,RCC 返回码:{result.returncode}。") | ||
return result.returncode | ||
|
||
|
||
def gen_ts(lang: str = "zh_CN") -> int: | ||
"""调用 lupdate 工具分析源码,生成 .ts 文本翻译文件 | ||
:param lang: 目标翻译语言代码 | ||
:return: lupdate 返回码 | ||
""" | ||
|
||
source = [*list(WIDGETS_PATH.glob("**/*.py")), SRC_PKG_PATH / "__main__.py"] | ||
target = RESOURCES_PATH / "i18n" / f"{lang.replace('-', '_')}.ts" | ||
cmd = ["pyside6-lupdate", *source, "-ts", target] | ||
|
||
try: | ||
result = subprocess.run(cmd, cwd=PROJECT_ROOT, check=True) | ||
except subprocess.SubprocessError as e: | ||
print(f"lupdate 进程错误:{e}") | ||
raise | ||
else: | ||
print(f"已完成文本翻译文件生成,lupdate 返回码:{result.returncode}。") | ||
return result.returncode | ||
|
||
|
||
def gen_qm(lang: str = "zh_CN") -> int: | ||
"""调用 lrelease 工具编译.ts 文本翻译文件 | ||
:param lang: 目标翻译语言代码 | ||
:return: lrelease 返回码 | ||
""" | ||
|
||
source = RESOURCES_PATH / "i18n" / f"{lang.replace('-', '_')}.ts" | ||
target = RESOURCES_PATH / "i18n" / f"{lang.replace('-', '_')}.qm" | ||
cmd = ["pyside6-lrelease", source, "-qm", target] | ||
|
||
try: | ||
result = subprocess.run(cmd, cwd=PROJECT_ROOT, check=True) | ||
except subprocess.SubprocessError as e: | ||
print(f"lrelease 进程错误:{e}") | ||
raise | ||
else: | ||
print(f"已完成文本翻译文件编译,lrelease 返回码:{result.returncode}。") | ||
return result.returncode | ||
|
||
|
||
if __name__ == "__main__": | ||
# compile_resources() | ||
gen_ts("zh_CN") | ||
# gen_qm("zh_CN") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
[tool.poetry] | ||
name = "py2exe-gui" | ||
version = "0.3.0" | ||
version = "0.3.1" | ||
description = "GUI for PyInstaller, based on PySide6" | ||
keywords = ["PyInstaller", "GUI", "PySide6"] | ||
authors = ["muzing <[email protected]>"] | ||
license = "GPL-3.0-or-later" | ||
readme = ["README.md", "README_zh.md"] | ||
repository = "https://github.com/muziing/Py2exe-GUI" | ||
exclude = ["src/py2exe_gui/Resources/Icons", "src/py2exe_gui/Resources/Texts"] | ||
exclude = ["src/py2exe_gui/Resources"] | ||
include = ["src/py2exe_gui/Resources/COMPILED_RESOURCES.py"] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Operating System :: Microsoft :: Windows", | ||
|
@@ -32,12 +33,11 @@ PySide6 = "^6.6.0" | |
pyyaml = "^6.0.1" | ||
|
||
[tool.poetry.group.dev] | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
pre-commit = "^3.5.0" | ||
black = "^23.12.0" | ||
isort = "^5.13.0" | ||
ruff = "^0.1.9" | ||
ruff = "^0.1.11" | ||
mypy = "^1.8.0" | ||
pyinstaller = "^6.2.0" | ||
types-pyyaml = "^6.0.12.12" | ||
|
Oops, something went wrong.