summaryrefslogtreecommitdiff
path: root/Mailman/Defaults.py
diff options
context:
space:
mode:
Diffstat (limited to 'Mailman/Defaults.py')
-rw-r--r--Mailman/Defaults.py20
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