Author: waldi Date: Wed Mar 5 13:47:19 2008 New Revision: 10716 Log: lib/dkt/bootconfig/base.py: Use dkt.support.version.
Modified: people/waldi/dkt/lib/dkt/bootconfig/base.py Modified: people/waldi/dkt/lib/dkt/bootconfig/base.py ============================================================================== --- people/waldi/dkt/lib/dkt/bootconfig/base.py (original) +++ people/waldi/dkt/lib/dkt/bootconfig/base.py Wed Mar 5 13:47:19 2008 @@ -1,7 +1,6 @@ -from itertools import izip - from interfaces import IBootBaseConfig from dkt.imageconfig.interfaces import IImageBaseConfig +from dkt.support.version import VersionImage from zope.interface import implements class BootConfigBase(object): @@ -12,25 +11,10 @@ def __cmp__(self, other): other = IBootBaseConfig(other) - version_self = '-'.split(self.version) - version_other = '-'.split(other.version) - - ret = cmp(len(version_self), len(version_other)) - if ret: - return ret - - for v_self, v_other in izip(version_self, version_other): - part_self = '.'.split(v_self) - part_other = '.'.split(v_other) - - ret = cmp(part_self, part_other) - if ret: - return ret - - features_self = self.features - features_other = other.features - return cmp(features_self, features_other) + ret = cmp(self.version, other.version) + if ret: return ret + return cmp(self.features, other.features) @property def features(self): @@ -38,5 +22,5 @@ @property def version(self): - return IImageBaseConfig(self.config).version + return VersionImage(IImageBaseConfig(self.config).version) _______________________________________________ Kernel-svn-changes mailing list Kernel-svn-changes@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/kernel-svn-changes