extend '-A / --abort' & '"skip": "abort"' functionality (#7891)
implement ascending by more than 1 level or up to an extractor with a specific subcategory
This commit is contained in:
@@ -160,6 +160,22 @@ class ControlException(GalleryDLException):
|
||||
class StopExtraction(ControlException):
|
||||
"""Stop data extraction"""
|
||||
|
||||
def __init__(self, target=None):
|
||||
ControlException.__init__(self)
|
||||
|
||||
if target is None:
|
||||
self.target = None
|
||||
self.depth = 1
|
||||
elif isinstance(target, int):
|
||||
self.target = None
|
||||
self.depth = target
|
||||
elif target.isdecimal():
|
||||
self.target = None
|
||||
self.depth = int(target)
|
||||
else:
|
||||
self.target = target
|
||||
self.depth = 128
|
||||
|
||||
|
||||
class AbortExtraction(ExtractionError, ControlException):
|
||||
"""Abort data extraction due to an error"""
|
||||
|
||||
Reference in New Issue
Block a user