if sys.modules.has_key('wx') or sys.modules.has_key('wxPython'):
raise AlreadyImportedError('wxversion.ensureMinimal() must be called before wxPython is imported')
sys.modules.has_key('wxPython')
bestMatch = None
minv = _wxPackageInfo(minVersion)
defaultPath = _find_default()
if defaultPath:
defv = _wxPackageInfo(defaultPath, True)
if defv >= minv and minv.CheckOptions(defv, optionsRequired):
bestMatch = defv
if bestMatch is None:
installed = _find_installed()
for inst in installed:
if inst >= minv and minv.CheckOptions(inst, optionsRequired):
bestMatch = inst
break
continue
if bestMatch is None:
if _EM_DEBUG:
raise VersionError('Requested version of wxPython not found')
_EM_DEBUG
import wx
import webbrowser as webbrowser
versions = []([ ' ' + ver for ver in getInstalled() ])
app = wx.PySimpleApp()
result = wx.MessageBox('This application requires a version of wxPython greater than or equal to %s, but a matching version was not found.\n\nYou currently have these version(s) installed:\n%s\n\nWould you like to download a new version of wxPython?\n' % (minVersion, versions), 'wxPython Upgrade Needed', style = wx.YES_NO)