Added times to tests.
[zeroinstall.git] / freshness.py
blob5c5825252cce57d4e4701730c19e024d72bda8bd
1 class Freshness(object):
2 __slots__ = ['time', 'text']
4 def __init__(self, time, text):
5 self.time = time
6 self.text = text
8 def __str__(self):
9 return self.text
11 freshness_levels = [
12 Freshness(-1, 'No automatic updates'),
13 Freshness(0, 'Always update'),
14 Freshness(60, 'Up to one minute old'),
15 Freshness(60 * 60, 'Up to one hour old'),
16 Freshness(24 * 60 * 60, 'Up to one day old'),
17 Freshness(7 * 24 * 60 * 60, 'Up to one week old'),
18 Freshness(30 * 24 * 60 * 60, 'Up to one month old'),
19 Freshness(365 * 24 * 60 * 60, 'Up to one year old'),