From a309da3748345d064643b3b96aca07f2c5a8787b Mon Sep 17 00:00:00 2001 From: sithis Date: Wed, 6 May 2020 09:11:40 +0100 Subject: [PATCH 1/4] - Fixed GUI project path - Removed expand flag from sizer where it wasn't needed --- gui_project_files/CrypterBuilder/crypter_builder_final.fbp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui_project_files/CrypterBuilder/crypter_builder_final.fbp b/gui_project_files/CrypterBuilder/crypter_builder_final.fbp index 9fbf9fb..aa61ddf 100644 --- a/gui_project_files/CrypterBuilder/crypter_builder_final.fbp +++ b/gui_project_files/CrypterBuilder/crypter_builder_final.fbp @@ -18,7 +18,7 @@ 0 CrypterBuilder - C:\dev\py\Crypter\build\ExeBuilder + C:\dev\py\Crypter\CrypterBuilder 1 1 @@ -586,7 +586,7 @@ none 5 - wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND + wxALIGN_CENTER_HORIZONTAL|wxALL 0 1 From fe0cf697bc4d67bb9110c12735a709459831e44f Mon Sep 17 00:00:00 2001 From: sithis Date: Wed, 6 May 2020 09:12:25 +0100 Subject: [PATCH 2/4] Added check in Builder to make sure user is on a valid version of Python before proceeding. If version is not supported, a wx dialog will be used to present a warning --- Builder.pyw | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Builder.pyw b/Builder.pyw index dfb8795..70d7ae2 100644 --- a/Builder.pyw +++ b/Builder.pyw @@ -4,8 +4,32 @@ ''' # Import libs -import win32api +import wx +import sys from CrypterBuilder import Builder +# Process Version +PY_MAJ_VERSION = sys.version_info[0] +PY_MIN_VERSION = sys.version_info[1] + +def showErrorDialog(message): + ''' + Displays an error dialog containing the specified message + ''' + + app = wx.App() + error_dialog = wx.MessageDialog(None, str(message), "Error", wx.OK | wx.ICON_ERROR) + error_dialog.ShowModal() + app.MainLoop() + +# Check Version +if PY_MAJ_VERSION != 3 or (PY_MIN_VERSION != 6 and PY_MIN_VERSION != 7): + showErrorDialog( + "Python 3.6 or 3.7 is required to use this project. version %s.%s is" + " not supported" % (PY_MAJ_VERSION, PY_MIN_VERSION) + ) + sys.exit() + +# Open Builder builder = Builder() builder.launch() \ No newline at end of file From a0f4fd97598bd59f51fca260e042af89db475b20 Mon Sep 17 00:00:00 2001 From: sithis Date: Wed, 6 May 2020 09:13:11 +0100 Subject: [PATCH 3/4] Corrected relative path issues --- CrypterBuilder/Base.py | 3 ++- CrypterBuilder/BuilderGuiAbsBase.py | 2 +- CrypterBuilder/Spec.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CrypterBuilder/Base.py b/CrypterBuilder/Base.py index 1a8c225..cd9e657 100644 --- a/CrypterBuilder/Base.py +++ b/CrypterBuilder/Base.py @@ -364,7 +364,8 @@ "delete_shadow_copies" ] -RUNTIME_CONFIG_PATH = os.path.join(os.path.dirname(__file__), "Resources", "runtime.cfg") +PACKAGE_DIR = os.path.dirname(__file__) +RUNTIME_CONFIG_PATH = os.path.join(PACKAGE_DIR, "Resources", "runtime.cfg") # ERRORS ERROR_INVALID_DATA = 13 diff --git a/CrypterBuilder/BuilderGuiAbsBase.py b/CrypterBuilder/BuilderGuiAbsBase.py index 60f10fd..f923138 100644 --- a/CrypterBuilder/BuilderGuiAbsBase.py +++ b/CrypterBuilder/BuilderGuiAbsBase.py @@ -91,7 +91,7 @@ def __init__( self, parent ): self.TitleLabel.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_GRAYTEXT ) ) self.TitleLabel.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOW ) ) - bSizer44.Add( self.TitleLabel, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL|wx.EXPAND, 5 ) + bSizer44.Add( self.TitleLabel, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 5 ) self.SubtitleLabel = wx.StaticText( self.GuideScrollableWindow, wx.ID_ANY, u"Created by Sithis993", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTER_HORIZONTAL ) self.SubtitleLabel.Wrap( -1 ) diff --git a/CrypterBuilder/Spec.py b/CrypterBuilder/Spec.py index 13bda35..756882d 100644 --- a/CrypterBuilder/Spec.py +++ b/CrypterBuilder/Spec.py @@ -9,7 +9,7 @@ from pubsub import pub # Import package modules - +from . import Base ################ ## SPEC CLASS ## @@ -19,7 +19,7 @@ class Spec(): @summary: Provides a SPEC file object ''' - SPEC_TEMPLATE_PATH = os.path.join("CrypterBuilder", "Resources", "Template.spec") + SPEC_TEMPLATE_PATH = os.path.join(Base.PACKAGE_DIR, "Resources", "Template.spec") SPEC_OUT_PATH = "Main.spec" def __init__(self): From 29dfe297ab9b67a5f87fe84b68122c0b4c3fe77d Mon Sep 17 00:00:00 2001 From: sithis Date: Wed, 6 May 2020 09:14:09 +0100 Subject: [PATCH 4/4] Got rid of some unnecessary imports --- CrypterBuilder/Builder.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/CrypterBuilder/Builder.py b/CrypterBuilder/Builder.py index 7556418..0f57913 100644 --- a/CrypterBuilder/Builder.py +++ b/CrypterBuilder/Builder.py @@ -5,13 +5,9 @@ # Import libs import wx -import json -import time # Import package modules from .Gui import Gui -from .Exceptions import * -from .Base import * ################### ## BUILDER CLASS ## @@ -36,6 +32,5 @@ def launch(self): Launches the Builder GUI ''' - self.__builder_gui.Show() self.__app.MainLoop()