Doc and comment updates

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30097 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-10-25 22:53:36 +00:00
parent 3dd4386160
commit 0148e4348e

View File

@@ -53,6 +53,9 @@ that and only use wxversion if needed. For example, for py2exe::
wxversion.select('2.5') wxversion.select('2.5')
import wx import wx
More documentation on wxversion and multi-version installs can be
found at: http://wiki.wxpython.org/index.cgi/MultiVersionInstalls
""" """
import sys, os, glob, fnmatch import sys, os, glob, fnmatch
@@ -103,8 +106,8 @@ def select(versions):
# otherwise, raise an exception # otherwise, raise an exception
raise VersionError("A previously selected wx version does not match the new request.") raise VersionError("A previously selected wx version does not match the new request.")
# If we get here then this is the first time wxversion is used. # If we get here then this is the first time wxversion is used,
# Ensure that wxPython hasn't been imported yet. # ensure that wxPython hasn't been imported yet.
if sys.modules.has_key('wx') or sys.modules.has_key('wxPython'): if sys.modules.has_key('wx') or sys.modules.has_key('wxPython'):
raise VersionError("wxversion.require() must be called before wxPython is imported") raise VersionError("wxversion.require() must be called before wxPython is imported")
@@ -220,11 +223,12 @@ class _wxPackageInfo(object):
def Score(self, other): def Score(self, other):
score = 0 score = 0
# whatever version components given in other must match exactly # whatever number of version components given in other must
# match exactly
minlen = min(len(self.version), len(other.version)) minlen = min(len(self.version), len(other.version))
if self.version[:minlen] != other.version[:minlen]: if self.version[:minlen] != other.version[:minlen]:
return 0 return 0
score += 1 # todo: should it be +=minlen to reward longer matches? score += 1
for opt in other.options: for opt in other.options:
if opt in self.options: if opt in self.options: