From e8a2abf8cf173de6a8c9caec469f8d0ca73a34cc Mon Sep 17 00:00:00 2001 From: Roland Hedberg Date: Fri, 6 Nov 2009 19:41:36 +0100 Subject: [PATCH] Improved usability --- src/saml2/time_util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/saml2/time_util.py b/src/saml2/time_util.py index 5be547e..64d8912 100644 --- a/src/saml2/time_util.py +++ b/src/saml2/time_util.py @@ -162,14 +162,16 @@ def add_duration(tid, duration): # --------------------------------------------------------------------------- -def in_a_while(*args): +def in_a_while(days=0, seconds=0, microseconds=0, milliseconds=0, + minutes=0, hours=0, weeks=0): """ format of timedelta: timedelta([days[, seconds[, microseconds[, milliseconds[, minutes[, hours[, weeks]]]]]]]) """ now = datetime.now() - t = timedelta(*args) + t = timedelta(*[days,seconds,microseconds,milliseconds,minutes, + hours,weeks]) soon = now + t return soon.strftime(TIME_FORMAT)