[actions] add 'abort' and 'terminate' actions (#5778)

pull/5824/head
Mike Fährmann 3 months ago
parent d80f4fbc10
commit c9860002ba
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -984,6 +984,10 @@ Description
| Can be one of ``debug``, ``info``, ``warning``, ``error`` or an integer value. | Can be one of ``debug``, ``info``, ``warning``, ``error`` or an integer value.
``print`` ``print``
Write argument to stdout. Write argument to stdout.
``abort``:
Stop the current extractor run.
``terminate``:
Stop the current extractor run, including parent extractors.
``restart``: ``restart``:
Restart the current extractor run. Restart the current extractor run.
``wait``: ``wait``:

@ -299,6 +299,8 @@ def main():
else: else:
input_manager.success() input_manager.success()
except exception.StopExtraction:
pass
except exception.TerminateExtraction: except exception.TerminateExtraction:
pass pass
except exception.RestartExtraction: except exception.RestartExtraction:

@ -86,6 +86,14 @@ def action_wait(opts):
return _wait return _wait
def action_abort(opts):
return util.raises(exception.StopExtraction)
def action_terminate(opts):
return util.raises(exception.TerminateExtraction)
def action_restart(opts): def action_restart(opts):
return util.raises(exception.RestartExtraction) return util.raises(exception.RestartExtraction)
@ -102,10 +110,12 @@ def action_exit(opts):
ACTIONS = { ACTIONS = {
"print" : action_print, "print" : action_print,
"status" : action_status, "status" : action_status,
"level" : action_level, "level" : action_level,
"restart": action_restart, "abort" : action_abort,
"wait" : action_wait, "terminate": action_terminate,
"exit" : action_exit, "restart" : action_restart,
"wait" : action_wait,
"exit" : action_exit,
} }

Loading…
Cancel
Save