summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-15 21:37:04 +0100
committermathieui <mathieui@mathieui.net>2011-11-15 21:37:04 +0100
commit9a32229d0bcadf5fcccb493f18efb0e240b1fa6c (patch)
tree4f9c513926b9d1a3d462a607f7ac88c1fea38024
parent403406b60a0889b8f064604c9a6147cb06b55455 (diff)
downloadpoezio-9a32229d0bcadf5fcccb493f18efb0e240b1fa6c.tar.gz
poezio-9a32229d0bcadf5fcccb493f18efb0e240b1fa6c.tar.bz2
poezio-9a32229d0bcadf5fcccb493f18efb0e240b1fa6c.tar.xz
poezio-9a32229d0bcadf5fcccb493f18efb0e240b1fa6c.zip
Add the 's' modifier (allow a string to be "50s1d1d4m1s")
-rw-r--r--src/common.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/common.py b/src/common.py
index 48613847..fdad77a9 100644
--- a/src/common.py
+++ b/src/common.py
@@ -194,7 +194,7 @@ def replace_key_with_bound(key):
return key
def parse_str_to_secs(duration=''):
- values = {'m': 60, 'h': 3600, 'd': 86400}
+ values = {'s': 1, 'm': 60, 'h': 3600, 'd': 86400}
result = 0
tmp = '0'
for char in duration:
@@ -211,7 +211,6 @@ def parse_str_to_secs(duration=''):
return result
def parse_secs_to_str(duration=0):
- values = {60: 'm', 3600:'h', 86400:'d'}
secs, mins, hours, days = 0, 0, 0, 0
result = ''
secs = duration % 60