bootstrap-vz/base/phase.py

22 lines
406 B
Python
Raw Normal View History

2013-06-23 17:54:25 +02:00
from functools import total_ordering
2013-06-23 17:54:25 +02:00
@total_ordering
class Phase(object):
description = None
def __init__(self):
pass
2013-06-23 17:54:25 +02:00
def __lt__(self, other):
from common.phases import order
2013-06-23 17:54:25 +02:00
return order.index(self) < order.index(other)
def __eq__(self, other):
return self == other
def __str__(self):
return '{name}'.format(name=self.__class__.__name__)
2013-06-23 17:54:25 +02:00
def __repr__(self):
return self.__str__()