From 946e199bf42c17a96e69e0ffa359b9eb4252763c Mon Sep 17 00:00:00 2001 From: Matic Kukovec Date: Sat, 27 May 2023 10:58:43 +0200 Subject: [PATCH] Version 7.4: new terminal integration and freezing upgrade --- data.py | 2 +- utilities/freeze_exco.py | 62 ++++++++++++++++++++++++++-------------- 2 files changed, 41 insertions(+), 23 deletions(-) diff --git a/data.py b/data.py index 3441207..f771145 100644 --- a/data.py +++ b/data.py @@ -76,7 +76,7 @@ configuration file! -------------------------------------------------------- """ -application_version = "7.3" +application_version = "7.4" # Global variable that holds state of logging mode logging_mode = False # Global referenc to the log display window, so it can be used anywhere diff --git a/utilities/freeze_exco.py b/utilities/freeze_exco.py index 32ff14d..4f6b04b 100644 --- a/utilities/freeze_exco.py +++ b/utilities/freeze_exco.py @@ -9,13 +9,20 @@ def main(): - file_directory = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) + file_directory = os.path.join( + os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))), + "..", + ) output_directory = "frozen_exco_{}_{}".format( platform.system().lower(), platform.architecture()[0], ) - builtin_modules = [] + builtin_modules = [ + "PyQt6", + "PyQt6.Qsci", + "PyQt6.QtTest", + ] local_modules = [] # List all local modules exclude_dirs = [ @@ -48,6 +55,7 @@ def main(): continue local_modules.append(new_module) pprint.pprint(local_modules) + modules = local_modules + builtin_modules search_path = sys.path @@ -60,30 +68,39 @@ def main(): executable_name = "ExCo" if platform.system().lower() == "windows": base = "Win32GUI" + + builtin_modules.extend([ + "win32api", + "win32con", + "win32gui", + "win32file", + ]) + excludes = [ "tkinter", -# "PyQt5", -# "PyQt5.QtCore", -# "PyQt5.QtWidgets", -# "PyQt5.QtGui", -# "PyQt5.Qsci", -# "PyQt5.QtTest", - "PyQt6", - "PyQt6.QtCore", - "PyQt6.QtWidgets", - "PyQt6.QtGui", - "PyQt6.Qsci", - "PyQt6.QtTest", + "PyQt5", + "PyQt5.QtCore", + "PyQt5.QtWidgets", + "PyQt5.QtGui", + "PyQt5.Qsci", + "PyQt5.QtTest", +# "PyQt6", +# "PyQt6.QtCore", +# "PyQt6.QtWidgets", +# "PyQt6.QtGui", +# "PyQt6.Qsci", +# "PyQt6.QtTest", ] + executable_name = "ExCo.exe" executables = [ cx_Freeze.Executable( 'exco.py', - initScript = None, + init_script = None, base = base, icon = "resources/exco-icon-win.ico", - targetName = executable_name, + target_name = executable_name, ) ] @@ -91,16 +108,17 @@ def main(): executables, includes = modules, excludes = excludes, - replacePaths = [], + replace_paths = [], compress = True, - optimizeFlag = True, + optimize = True, + include_msvcr = True, path = search_path, - targetDir = output_directory, - includeFiles = [], - zipIncludes = [], + target_dir = output_directory, + include_files = [], + zip_includes = [], silent = False, ) - freezer.Freeze() + freezer.freeze() shutil.copytree("resources", output_directory + "/resources")