Skip to content

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
GT-ZhangAcer committed Nov 25, 2023
1 parent 3b4523c commit b843265
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 21 deletions.
7 changes: 4 additions & 3 deletions QPTSFX/QPTSFX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
#include <iostream>
using namespace std;

// 切记,不能是64位,不然PE不好修改了
// 切记,不能是64位,不然PE不好修改了 - 项目->属性->C/C++->代码生成->运行库->多线程MT
// 无窗口模式
//#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )
#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )

int main(int argc, char** argv) {

struct stat buffer;
const char *configsFile = ".\\configs\\entry.cmd";
if (stat(configsFile, &buffer) != 0) {
MessageBox(NULL, TEXT("QPT:configs文件夹存在文件缺失,已终止!"), TEXT("执行失败 - QPT封装工具"), MB_OK | MB_ICONSTOP);
return 1;
};
// 配置UTF-8
//配置UTF-8
SetConsoleCP(CP_UTF8);
SetConsoleOutputCP(CP_UTF8);

Expand Down
1 change: 1 addition & 0 deletions QPTSFX/QPTSFX.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down
Binary file modified qpt/ext/launcher/Main.exe
Binary file not shown.
Binary file modified qpt/ext/launcher_debug/Debug.exe
Binary file not shown.
13 changes: 7 additions & 6 deletions qpt/modules/python_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def __init__(self, version: str = None, mode=PYTHON_ENV_MODE_SPEED_FIRST):
self.mode = mode

def act(self) -> None:
# ToDo 增加版本控制
v = f"python{self.version.replace('.', '')}"
path = check_and_install_sdk_in_this_env("QEnvPython")
copytree(os.path.join(path, v), os.path.join(self.module_path, "Python"))
Expand Down Expand Up @@ -70,11 +71,6 @@ def __init__(self, mode=DEFINE_PYTHON_ENV_MODE):
super().__init__(name=None, mode=mode, version=version)


class Python37(BasePythonEnv):
def __init__(self, mode=DEFINE_PYTHON_ENV_MODE):
super().__init__(name=None, version="3.7", mode=mode)


class Python38(BasePythonEnv):
def __init__(self, mode=DEFINE_PYTHON_ENV_MODE):
super().__init__(name=None, version="3.8", mode=mode)
Expand All @@ -87,4 +83,9 @@ def __init__(self, mode=DEFINE_PYTHON_ENV_MODE):

class Python310(BasePythonEnv):
def __init__(self, mode=DEFINE_PYTHON_ENV_MODE):
super().__init__(name=None, version="3.9", mode=mode)
super().__init__(name=None, version="3.10", mode=mode)


class Python311(BasePythonEnv):
def __init__(self, mode=DEFINE_PYTHON_ENV_MODE):
super().__init__(name=None, version="3.11", mode=mode)
12 changes: 0 additions & 12 deletions unit_test/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@

class LogTest(unittest.TestCase):

def test_module_m_gui_python37(self):
# 验证Python兼容性
module = CreateExecutableModule(work_dir="./sandbox_m",
launcher_py_path="./sandbox_m/run.py",
save_path=os.path.join(OUT_DIR_ROOT, sys._getframe().f_code.co_name),
requirements_file="sandbox_m/requirements_with_opt.txt",
interpreter_module=Python37(),
icon="./sandbox_paddleocr/favicon.ico",
with_debug=True,
hidden_terminal=True)
module.make()

def test_module_m_gui_python38(self):
# 验证Python兼容性
module = CreateExecutableModule(work_dir="./sandbox_m",
Expand Down

0 comments on commit b843265

Please sign in to comment.