diff options
| author | viega | 1998-06-12 09:54:06 +0000 |
|---|---|---|
| committer | viega | 1998-06-12 09:54:06 +0000 |
| commit | 96f5a41efe232bf4e4935d2539c4f6f54cb54b96 (patch) | |
| tree | de5e004b09daf5ef7d95204b08bf7f5414a46e9a /modules/versions.py | |
| parent | ac7da0bd823c5d539a34d2a92ca5c806b42532cc (diff) | |
| download | mailman-96f5a41efe232bf4e4935d2539c4f6f54cb54b96.tar.gz mailman-96f5a41efe232bf4e4935d2539c4f6f54cb54b96.tar.zst mailman-96f5a41efe232bf4e4935d2539c4f6f54cb54b96.zip | |
Fixed a bug that arose from changing file format versions to a number.
Commented out code that expected a string. It's now a number just so
every time mailman starts up there isn't a whole lot of work done in
checking the version, etc. Our numbers should stick with
integers... other people making local mods should probably use decimal
places...
Diffstat (limited to 'modules/versions.py')
| -rw-r--r-- | modules/versions.py | 87 |
1 files changed, 45 insertions, 42 deletions
diff --git a/modules/versions.py b/modules/versions.py index ea9c7d9f6..6b41725a2 100644 --- a/modules/versions.py +++ b/modules/versions.py @@ -32,7 +32,7 @@ updates the data_version number of the list, and then does a .Save(), so the transformations won't be run again until another version change is detected.""" -__version__ = "$Revision: 547 $" +__version__ = "$Revision: 721 $" import re, string, types import mm_cfg @@ -80,51 +80,54 @@ def older(version, reference): """True if version is older than current. Different numbering systems imply version is older.""" - + if type(version) != type(reference): + return 1 + if version >= reference: + return 0 + else: + return 1 # Iterate over the repective contiguous sections of letters and digits # until a section from the reference is found to be different than the # corresponding version section, and return the sense of the # difference. If no differences are found, then 0 is returned. - for v, r in map(None, section(version), section(reference)): - if r == None: + #for v, r in map(None, section(version), section(reference)): + # if r == None: # Reference is a full release and version is an interim - eg, # alpha or beta - which precede full, are older: - return 1 - if type(v) != type(r): - # Numbering system changed. - return 1 - if v < r: - return 1 - if v > r: - return 0 - return 0 + # return 1 + # if type(v) != type(r): + # # Numbering system changed. + # return 1 + # if v < r: + # return 1 + # if v > r: + # return 0 + # return 0 -def section(s): - """Split string into contiguous sequences of letters and digits.""" - section = "" - got = [] - wasat = "" - for c in s: - if c in string.letters: - at = string.letters; add = c - elif c in string.digits: - at = string.digits; add = c - else: - at = ""; add = "" - - if at == wasat: # In continuous sequence. - section = section + add - else: # Switching. - if section: - if wasat == string.digits: - section = int(section) - got.append(section) - section = add - wasat = at - if section: # Get trailing stuff. - if wasat == string.digits: - section = int(section) - got.append(section) - return got - - +#def section(s): +# """Split string into contiguous sequences of letters and digits.""" +# section = "" +# got = [] +# wasat = "" +# for c in s: +# if c in string.letters: +# at = string.letters; add = c +# elif c in string.digits: +# at = string.digits; add = c +# else: +# at = ""; add = "" +# +# if at == wasat: # In continuous sequence. +# section = section + add +# else: # Switching. +# if section: +# if wasat == string.digits: +# section = int(section) +# got.append(section) +# section = add +# wasat = at +# if section: # Get trailing stuff. +# if wasat == string.digits: +# section = int(section) +# got.append(section) +# return got |
