sleep defaults to one second
This commit is contained in:
parent
c0d06adcb5
commit
2b676b63b1
2 changed files with 3 additions and 2 deletions
|
|
@ -1774,8 +1774,8 @@ def doit(activation_token: str = '') -> None:
|
|||
else:
|
||||
doit()
|
||||
|
||||
@ac('misc', 'Sleep for the specified time period')
|
||||
def sleep(self, sleep_time: float) -> None:
|
||||
@ac('misc', 'Sleep for the specified time period. Suffix can be s for seconds, m, for minutes, h for hours and d for days. The time can be fractional.')
|
||||
def sleep(self, sleep_time: float = 1.0) -> None:
|
||||
sleep(sleep_time)
|
||||
|
||||
@ac('misc', 'Click a URL using the keyboard')
|
||||
|
|
|
|||
|
|
@ -296,6 +296,7 @@ def single_integer_arg(func: str, rest: str) -> FuncArgsType:
|
|||
@func_with_args('sleep')
|
||||
def sleep(func: str, sleep_time: str) -> FuncArgsType:
|
||||
mult = 1
|
||||
sleep_time = sleep_time or '1'
|
||||
if sleep_time[-1] in 'shmd':
|
||||
mult = {'s': 1, 'm': 60, 'h': 3600, 'd': 24 * 3600}[sleep_time[-1]]
|
||||
sleep_time = sleep_time[:-1]
|
||||
|
|
|
|||
Loading…
Reference in a new issue