Skip to content

Commit

Permalink
V1.0b7 Release!
Browse files Browse the repository at this point in the history
  • Loading branch information
GT-ZhangAcer committed Nov 26, 2023
1 parent 2802071 commit df38375
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 20 deletions.
12 changes: 8 additions & 4 deletions qpt/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def make(self):
dst=os.path.join(self.debug_path, "configs/entry.cmd"))
# 注册主程序文件路径
with open(os.path.join(self.debug_path, "configs/entry.cmd"), "r", encoding="utf-8") as f:
data = f.read().replace("QPT_PY_MAIN_FILE=NONE", "QPT_PY_MAIN_FILE=" + self.launcher_py_path[0])
data = f.read().replace("QPT_PY_MAIN_FILE=NONE", "QPT_PY_MAIN_FILE=resources/" + self.launcher_py_path[0])
with open(os.path.join(self.debug_path, "configs/entry.cmd"), "w", encoding="utf-8") as f:
f.write(data)

Expand All @@ -296,7 +296,7 @@ def make(self):
# 重命名兼容模式文件
compatibility_mode_file = os.path.join(self.debug_path, "compatibility_mode.cmd")
with open(os.path.join(self.debug_path, "compatibility_mode.cmd"), "r", encoding="utf-8") as f:
data = f.read().replace("QPT_PY_MAIN_FILE=NONE", "QPT_PY_MAIN_FILE=" + self.launcher_py_path[0])
data = f.read().replace("QPT_PY_MAIN_FILE=NONE", "QPT_PY_MAIN_FILE=resources/" + self.launcher_py_path[0])
with open(os.path.join(self.debug_path, "compatibility_mode.cmd"), "w", encoding="utf-8") as f:
f.write(data)
if os.path.exists(compatibility_mode_file):
Expand All @@ -318,13 +318,17 @@ def make(self):
dst=os.path.join(self.module_path, "configs/entry.cmd"))
# 注册主程序文件路径
with open(os.path.join(self.module_path, "configs/entry.cmd"), "r", encoding="utf-8") as f:
data = f.read().replace("QPT_PY_MAIN_FILE=NONE", "QPT_PY_MAIN_FILE=" + self.launcher_py_path[0])
data = f.read().replace("QPT_PY_MAIN_FILE=NONE", "QPT_PY_MAIN_FILE=resources/" + self.launcher_py_path[0])
with open(os.path.join(self.module_path, "configs/entry.cmd"), "w", encoding="utf-8") as f:
f.write(data)

copytree(launcher_ext_dir, dst=self.module_path, ignore_files=launcher_ignore_file)
# 重命名兼容模式文件
compatibility_mode_file = os.path.join(self.module_path, "compatibility_mode.cmd")
with open(compatibility_mode_file, "r", encoding="utf-8") as f:
data = f.read().replace("QPT_PY_MAIN_FILE=NONE", "QPT_PY_MAIN_FILE=resources/" + self.launcher_py_path[0])
with open(compatibility_mode_file, "w", encoding="utf-8") as f:
f.write(data)
if os.path.exists(compatibility_mode_file):
os.rename(compatibility_mode_file,
os.path.join(self.module_path, "使用兼容模式运行.cmd"))
Expand Down Expand Up @@ -511,5 +515,5 @@ def run(self):
else:
CheckRun.make_run_file(self.config_path)

os.chdir(self.work_dir)
# os.chdir(self.work_dir)
Logging.info("环境部署完毕!")
6 changes: 3 additions & 3 deletions qpt/ext/launcher/compatibility_mode.cmd
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
echo on
chcp 65001
cd /d %~dp0
cd ..

set QPT_COLOR=False
set QPT_MODE=Debug
set PYTHONUNBUFFERED=1
set PYTHONIOENCODING=utf-8
set PROMPT=(QPT_VENV) %PROMPT%

set QPT_PY_MAIN_FILE=NONE
set QPT_ARGS=%1
"./Python/python.exe" %QPT_PY_MAIN_FILE%%QPT_ARGS:QPT_ARGS_FLAG= %
"./Python/python.exe" %QPT_PY_MAIN_FILE% %*

echo 当前程序已执行结束,任意键后将进行关闭本程序。
pause
3 changes: 1 addition & 2 deletions qpt/ext/launcher_debug/compatibility_mode.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ set PYTHONIOENCODING=utf-8
set PROMPT=(QPT_VENV) %PROMPT%

set QPT_PY_MAIN_FILE=NONE
set QPT_ARGS=%1
"./Python/python.exe" %QPT_PY_MAIN_FILE%%QPT_ARGS:QPT_ARGS_FLAG= %
"./Python/python.exe" %QPT_PY_MAIN_FILE% %*

cls
pause
3 changes: 2 additions & 1 deletion qpt/kernel/qinterpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
BAIDU_PIP_SOURCE = "https://mirror.baidu.com/pypi/simple"
DOUBAN_PIP_SOURCE = "https://pypi.douban.com/simple"
BFSU_PIP_SOURCE = "https://mirrors.bfsu.edu.cn/pypi/web/simple"
ALIYUN_PIP_SOURCE = "https://mirrors.aliyun.com/pypi/simple"
PYPI_PIP_SOURCE = "https://pypi.python.org/simple"
DEFAULT_PIP_SOURCE = BFSU_PIP_SOURCE
DEFAULT_PIP_SOURCE = ALIYUN_PIP_SOURCE
# DEFAULT_PIP_SOURCE = DOUBAN_PIP_SOURCE

SIGNALS = ["=", "~", "<", ">"]
Expand Down
7 changes: 4 additions & 3 deletions qpt/kernel/qos.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ def check_and_install_sdk_in_this_env(name: str):
"""
在当前环境下检查某个个SDK是否被安装,若安装则返回SDK目录,未安装则进行安装
:param: name
:return: SDK path
:return: QPT SDK 的绝对路径
"""
sdk_list = QPT_MEMORY.get_qpt_sdk_list
if name.lower() not in sdk_list:
QPT_MEMORY.pip_tool_in_this_env.pip_package_shell(package=name)
import QPT_SDK
return os.path.abspath(os.path.join(os.path.dirname(QPT_SDK.__file__), name))
from QPT_SDK.loc import QPT_SDK_PATH

return QPT_SDK_PATH


def update_all_sdk_in_this_env():
Expand Down
4 changes: 2 additions & 2 deletions qpt/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ def get_win32api(self):

@init_wrapper()
def get_qpt_sdk_list(self):
import QPT_SDK
path_list = os.listdir(os.path.dirname(QPT_SDK.__file__))
from QPT_SDK.loc import QPT_SDK_PATH
path_list = os.listdir(QPT_SDK_PATH)
sdk_list = [path.lower() for path in path_list if os.path.isdir(path)]
return sdk_list

Expand Down
6 changes: 3 additions & 3 deletions qpt/modules/python_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ def act(self) -> None:
# ToDo 增加版本控制
m = f"python{self.version}"
path = check_and_install_sdk_in_this_env(f"QEnvPython{self.version}")
copytree(os.path.join(path, m), os.path.join(self.module_path, "Python"))
copytree(os.path.join(os.path.join(path, "QEnvPython"), m), os.path.join(self.module_path, "Python"))

# ToDo 未来对Tinkter和VC2019进行分离,先暂时放一起
m = f"tkinter{self.version}"
path = check_and_install_sdk_in_this_env(f"QEnvPython{self.version}")
copytree(os.path.join(path, m), os.path.join(self.module_path, "Python"))
copytree(os.path.join(os.path.join(path, "QEnvPython"), m), os.path.join(self.module_path, "Python"))

m = "vcredist"
path = check_and_install_sdk_in_this_env("QVCRedist")
copytree(os.path.join(path, m), os.path.join(self.module_path, "Python"))
copytree(os.path.join(os.path.join(path, "QVCRedist"), m), os.path.join(self.module_path, "Python"))


class BasePythonEnv(SubModule):
Expand Down
2 changes: 1 addition & 1 deletion qpt/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "1.0b4.dev6"
version = "1.0b4.dev7"
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"pefile",
"pillow",
"toml",
"pip>=22.1.1"],
"pip>=23.1,"
"QPT-SDK"],
python_requires='>=3.8',
include_package_data=True,
entry_points={
Expand Down

0 comments on commit df38375

Please sign in to comment.