implement the "exit" option for the "skip" config-key
This commit is contained in:
@@ -145,8 +145,10 @@ class PathFormat():
|
||||
skipmode = extractor.config("skip", True)
|
||||
if skipmode == "abort":
|
||||
self.exists = self._exists_abort
|
||||
elif skipmode == "exit":
|
||||
self.exists = self._exists_exit
|
||||
elif not skipmode:
|
||||
self.exists = self._exists_false
|
||||
self.exists = lambda: False
|
||||
|
||||
def open(self):
|
||||
"""Open file to 'realpath' and return a corresponding file object"""
|
||||
@@ -195,8 +197,9 @@ class PathFormat():
|
||||
raise exception.StopExtraction()
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def _exists_false():
|
||||
def _exists_exit(self):
|
||||
if self.has_extension and os.path.exists(self.realpath):
|
||||
exit()
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -49,9 +49,9 @@ def _generate_test(extr, tcase):
|
||||
|
||||
skip = [
|
||||
# dont work on travis-ci
|
||||
"exhentai", "kissmanga", "mangafox", "dynastyscans",
|
||||
"exhentai", "kissmanga", "mangafox", "dynastyscans", "nijie",
|
||||
# temporary issues
|
||||
|
||||
"imgchili",
|
||||
]
|
||||
# enable selective testing for direct calls
|
||||
if __name__ == '__main__' and len(sys.argv) > 1:
|
||||
|
||||
Reference in New Issue
Block a user