[actions] extend 'wait'
allow specifying a duration like for --sleep
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
""" """
|
""" """
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import time
|
||||||
import logging
|
import logging
|
||||||
import operator
|
import operator
|
||||||
from . import util, exception
|
from . import util, exception
|
||||||
@@ -87,8 +88,15 @@ def action_exec(opts):
|
|||||||
|
|
||||||
|
|
||||||
def action_wait(opts):
|
def action_wait(opts):
|
||||||
def _wait(args):
|
if opts:
|
||||||
input("Press Enter to continue")
|
seconds = util.build_duration_func(opts)
|
||||||
|
|
||||||
|
def _wait(args):
|
||||||
|
time.sleep(seconds())
|
||||||
|
else:
|
||||||
|
def _wait(args):
|
||||||
|
input("Press Enter to continue")
|
||||||
|
|
||||||
return _wait
|
return _wait
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user