implement the "exit" option for the "skip" config-key

pull/17/head
Mike Fährmann 7 years ago
parent cfbf79d788
commit ef90a2de2f
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -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:

Loading…
Cancel
Save