diff options
| author | Barry Warsaw | 2007-09-29 11:09:14 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2007-09-29 11:09:14 -0400 |
| commit | cbf2967239163e42cc2b25eece7bb5cb71b197fe (patch) | |
| tree | e8445a0af47c9c203107eea913f11dbc9229477b /Mailman/Defaults.py | |
| parent | 773980eb727b98c902b93894cafcd6bc7d22510d (diff) | |
| download | mailman-cbf2967239163e42cc2b25eece7bb5cb71b197fe.tar.gz mailman-cbf2967239163e42cc2b25eece7bb5cb71b197fe.tar.zst mailman-cbf2967239163e42cc2b25eece7bb5cb71b197fe.zip | |
Diffstat (limited to 'Mailman/Defaults.py')
| -rw-r--r-- | Mailman/Defaults.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Mailman/Defaults.py b/Mailman/Defaults.py index 592d6d0ff..8e55057e6 100644 --- a/Mailman/Defaults.py +++ b/Mailman/Defaults.py @@ -24,17 +24,27 @@ from Mailman.constants import * +class CompatibleTimeDelta(timedelta): + def __float__(self): + # Convert to float seconds. + return (self.days * 24 * 60 * 60 + + self.seconds + self.microseconds / 1.0e6) + + def __int__(self): + return int(float(self)) + + def seconds(s): - return timedelta(seconds=s) + return CompatibleTimeDelta(seconds=s) def minutes(m): - return timedelta(minutes=m) + return CompatibleTimeDelta(minutes=m) def hours(h): - return timedelta(hours=h) + return CompatibleTimeDelta(hours=h) def days(d): - return timedelta(days=d) + return CompatibleTimeDelta(days=d) # Some convenient constants @@ -714,7 +724,7 @@ MAX_AUTORESPONSES_PER_DAY = 10 # Qrunner defaults ##### -# Which queues should the qrunner master watchdog spawn? add_qrunners() takes +# Which queues should the qrunner master watchdog spawn? add_qrunner() takes # one required argument, which is the name of the qrunner to start # (capitalized and without the 'Runner' suffix). Optional second argument # specifies the number of parallel processes to fork for each qrunner. If |
