From 5101e575ba729495c0e7ffd12d52a988e53e7817 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Thu, 7 Jun 2012 11:46:01 -0400 Subject: [PATCH] Adding documentation for parse_timedelta --- common/lib/xmodule/capa_module.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/lib/xmodule/capa_module.py b/common/lib/xmodule/capa_module.py index baf3086e02..59e022cd16 100644 --- a/common/lib/xmodule/capa_module.py +++ b/common/lib/xmodule/capa_module.py @@ -28,6 +28,15 @@ def item(l, default="", process=lambda x: x): def parse_timedelta(time_str): + """ + time_str: A string with the following components: + day[s] (optional) + hour[s] (optional) + minute[s] (optional) + second[s] (optional) + + Returns a datetime.timedelta parsed from the string + """ parts = TIMEDELTA_REGEX.match(time_str) if not parts: return