(value)
| 694 | |
| 695 | |
| 696 | def parse_time(value): |
| 697 | if re.search("da(il)?y|today", value): |
| 698 | seconds = seconds_to_midnight() |
| 699 | |
| 700 | else: |
| 701 | _re = re.compile(r'(\d+| (?:this|an?) )\s*(hr|hour|min|sec|)', re.I) |
| 702 | seconds = sum((int(v) if v.strip() not in ("this", "a", "an") else 1) * |
| 703 | {'hr': 3600, 'hour': 3600, 'min': 60, 'sec': 1, '': 1}[u.lower()] |
| 704 | for v, u in _re.findall(value)) |
| 705 | return seconds |
| 706 | |
| 707 | |
| 708 | def timestamp(): |
no test coverage detected