X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b792147db7e5ceb5da741f5f6e27fea79944a04c..a55d039a23c730975a8b5efedab6b4940fb4009b:/wxPython/samples/ide/activegrid/tool/UICommon.py diff --git a/wxPython/samples/ide/activegrid/tool/UICommon.py b/wxPython/samples/ide/activegrid/tool/UICommon.py index 52c6a152dc..98f863a9da 100644 --- a/wxPython/samples/ide/activegrid/tool/UICommon.py +++ b/wxPython/samples/ide/activegrid/tool/UICommon.py @@ -14,6 +14,7 @@ import os import os.path import wx import ProjectEditor +import activegrid.util as utillib _ = wx.GetTranslation def CreateDirectoryControl( parent, fileLabel, dirLabel, fileExtension, startingName="", startingDirectory=""): @@ -56,6 +57,10 @@ def CreateDirectoryControl( parent, fileLabel, dirLabel, fileExtension, starting if nameControl.GetValue().find(' ') != -1: wx.MessageBox(_("Please provide a filename that does not contains spaces."), _("Spaces in Filename")) return False + if not os.path.exists(dirControl.GetValue()): + wx.MessageBox(_("That directory does not exist. Please choose an existing directory."), _("Provide a Valid Directory")) + return False + filePath = os.path.join(dirControl.GetValue(), MakeNameEndInExtension(nameControl.GetValue(), "." + fileExtension)) if os.path.exists(filePath): if allowOverwriteOnPrompt: @@ -113,4 +118,11 @@ def PluralName(name): return name[0:-1] + 'ies' else: return name + 's' - \ No newline at end of file + +def GetPythonExecPath(): + pythonExecPath = wx.ConfigBase_Get().Read("ActiveGridPythonLocation") + if not pythonExecPath: + pythonExecPath = utillib.pythonExecPath + return pythonExecPath + +