17 Commits

Author SHA1 Message Date
Mike Fährmann
0ef1fcab20 [postprocessor] update 'finalize' events
Add 'finalize-error' and 'finalize-success' events that trigger
depending on whether error(s) did or did not happen.

'finalize' itself now always triggers regardless of error status.
(was supposed to have the same behavior as the new 'finalize-success')
2023-08-10 19:46:37 +02:00
Mike Fährmann
b36125333f [postprocessor:zip] implement 'files' option (#2872) 2022-09-09 11:41:27 +02:00
Mike Fährmann
9704c04172 [postprocessor:zip] ensure target directory exists (#2758) 2022-07-14 11:55:39 +02:00
Mike Fährmann
b93cbe6720 [postprocessor:zip] run 'finalize()' regardless of 'filter' (#1460) 2021-06-07 22:15:36 +02:00
Mike Fährmann
3cbbefd4ed support 'filter' option for post processors (#1460) 2021-06-04 18:23:32 +02:00
Mike Fährmann
9fffa9c343 rework post processor callbacks 2020-11-19 02:29:06 +01:00
Mike Fährmann
fd0685d9b5 [postprocessor:zip] defer zip file creation (fixes #968)
don't try to create zip files on postprocessor construction,
wait until directory creation during file download,
2020-08-31 21:53:18 +02:00
Mike Fährmann
ece73b5b2a make 'path' and 'keywords' available in logging messages
Wrap all loggers used by job, extractor, downloader, and postprocessor
objects into a (custom) LoggerAdapter that provides access to the
underlying job, extractor, pathfmt, and kwdict objects and their
properties.

__init__() signatures for all downloader and postprocessor classes have
been changed to take the current Job object as their first argument,
instead of the current extractor or pathfmt.

(#574, #575)
2020-05-18 19:04:51 +02:00
Mike Fährmann
760b9b4db4 add remove_file() and remove_directory() helpers
these functions call os.unlink() or os.rmdir()
while catching and suppressing potential OSErrors
2020-01-18 00:21:26 +01:00
Mike Fährmann
9e88e7a344 [postprocessor:exec] improve (#421, #413)
- add 'final' option
- include job status in pp finalization
- improve and extend documentation
2019-11-03 21:45:45 +01:00
Mike Fährmann
60c8e090da [postprocessor:zip] fix archive names (closes #397)
Remove the trailing path separator introduced in 3284c62 before
adding the archive's filename extension.

[ci skip]
2019-08-24 23:14:26 +02:00
Mike Fährmann
a90280f4e7 [postprocessor:zip] add 'mode' option (#355) 2019-07-29 16:51:26 +02:00
Mike Fährmann
a01f99728c [postprocessor:zip] delete empty archives when done (#316) 2019-06-19 18:14:33 +02:00
Mike Fährmann
eec081dd3e [postprocessor:zip] delete directory (#85) 2018-06-11 18:08:12 +02:00
Mike Fährmann
baccf8a958 improve postprocessor handling
- add pathfmt argument for __init__()
- add finalization step
- add option to keep or delete zipped files
2018-06-08 17:39:02 +02:00
Mike Fährmann
97189e50cd [pp:zip] use temppath; add options 2018-06-06 20:49:52 +02:00
Mike Fährmann
d0ae3ed52c [postprocessor] add 'zip' to write files to a ZIP archive
(#85)
2018-05-22 16:54:17 +02:00