MCPcopy Index your code
hub / github.com/pyload/pyload / parse_time

Function parse_time

module/plugins/internal/misc.py:696–705  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

694
695
696def 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
708def timestamp():

Callers 4

check_errorsMethod · 0.85
check_errorsMethod · 0.85
_post_parametersMethod · 0.85
check_errorsMethod · 0.85

Calls 3

seconds_to_midnightFunction · 0.85
compileMethod · 0.80
searchMethod · 0.45

Tested by

no test coverage detected