mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
[actions] add 'abort' and 'terminate' actions (#5778)
This commit is contained in:
parent
d80f4fbc10
commit
c9860002ba
@ -984,6 +984,10 @@ Description
|
||||
| Can be one of ``debug``, ``info``, ``warning``, ``error`` or an integer value.
|
||||
``print``
|
||||
Write argument to stdout.
|
||||
``abort``:
|
||||
Stop the current extractor run.
|
||||
``terminate``:
|
||||
Stop the current extractor run, including parent extractors.
|
||||
``restart``:
|
||||
Restart the current extractor run.
|
||||
``wait``:
|
||||
|
@ -299,6 +299,8 @@ def main():
|
||||
else:
|
||||
input_manager.success()
|
||||
|
||||
except exception.StopExtraction:
|
||||
pass
|
||||
except exception.TerminateExtraction:
|
||||
pass
|
||||
except exception.RestartExtraction:
|
||||
|
@ -86,6 +86,14 @@ def action_wait(opts):
|
||||
return _wait
|
||||
|
||||
|
||||
def action_abort(opts):
|
||||
return util.raises(exception.StopExtraction)
|
||||
|
||||
|
||||
def action_terminate(opts):
|
||||
return util.raises(exception.TerminateExtraction)
|
||||
|
||||
|
||||
def action_restart(opts):
|
||||
return util.raises(exception.RestartExtraction)
|
||||
|
||||
@ -102,10 +110,12 @@ def action_exit(opts):
|
||||
|
||||
|
||||
ACTIONS = {
|
||||
"print" : action_print,
|
||||
"status" : action_status,
|
||||
"level" : action_level,
|
||||
"restart": action_restart,
|
||||
"wait" : action_wait,
|
||||
"exit" : action_exit,
|
||||
"print" : action_print,
|
||||
"status" : action_status,
|
||||
"level" : action_level,
|
||||
"abort" : action_abort,
|
||||
"terminate": action_terminate,
|
||||
"restart" : action_restart,
|
||||
"wait" : action_wait,
|
||||
"exit" : action_exit,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user