sleep defaults to one second
This commit is contained in:
parent
c0d06adcb5
commit
2b676b63b1
@ -1774,8 +1774,8 @@ class Boss:
|
|||||||
else:
|
else:
|
||||||
doit()
|
doit()
|
||||||
|
|
||||||
@ac('misc', 'Sleep for the specified time period')
|
@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) -> None:
|
def sleep(self, sleep_time: float = 1.0) -> None:
|
||||||
sleep(sleep_time)
|
sleep(sleep_time)
|
||||||
|
|
||||||
@ac('misc', 'Click a URL using the keyboard')
|
@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')
|
@func_with_args('sleep')
|
||||||
def sleep(func: str, sleep_time: str) -> FuncArgsType:
|
def sleep(func: str, sleep_time: str) -> FuncArgsType:
|
||||||
mult = 1
|
mult = 1
|
||||||
|
sleep_time = sleep_time or '1'
|
||||||
if sleep_time[-1] in 'shmd':
|
if sleep_time[-1] in 'shmd':
|
||||||
mult = {'s': 1, 'm': 60, 'h': 3600, 'd': 24 * 3600}[sleep_time[-1]]
|
mult = {'s': 1, 'm': 60, 'h': 3600, 'd': 24 * 3600}[sleep_time[-1]]
|
||||||
sleep_time = sleep_time[:-1]
|
sleep_time = sleep_time[:-1]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user