2
# Copyright (c) 2012 Canonical
4
# This file is part of Checkbox.
6
# Storm is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU Lesser General Public License as
8
# published by the Free Software Foundation; either version 2.1 of
9
# the License, or (at your option) any later version.
11
# Storm is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU Lesser General Public License for more details.
16
# You should have received a copy of the GNU Lesser General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
27
from checkbox.lib.enum import Enum
40
# Values for min scores
55
def __init__(self, value=None):
58
def __cmp__(self, other):
59
if not isinstance(other, Score):
72
return cmp(self.value, other.value)
74
def __lt__(self, other):
75
return self.__cmp__(other) < 0
77
def __le__(self, other):
78
return self.__cmp__(other) <= 0
80
def __gt__(self, other):
81
return self.__cmp__(other) > 0
83
def __ge__(self, other):
84
return self.__cmp__(other) >= 0
86
def __eq__(self, other):
87
return self.__cmp__(other) == 0
89
def __ne__(self, other):
90
return self.__cmp__(other) != 0
92
def __nonzero__(self):
93
return self.value is not None