Message299410
I'd propose an extra argument to zipapp.create_archive, include_file=None (feel free to bikeshed on the name). If the argument is not None, then it should be a callable which will be called with a pathlib.Path object for each file that's selected for inclusion in the archive. The function should return a boolean - False means don't include this file.
Because the create_archive function only gets a list of files internally (it uses Path.rglob()), the callable won't get passed directories, only the actual files (but it can of course check the full path to see what directory the file is in).
The include_file argument is ignored when copying anything other than a filesystem directory (i.e., when the source argument is a filename or an open file object). |
|
Date |
User |
Action |
Args |
2017-07-28 17:06:29 | paul.moore | set | recipients:
+ paul.moore, irmen |
2017-07-28 17:06:29 | paul.moore | set | messageid: <1501261589.15.0.913821735469.issue31072@psf.upfronthosting.co.za> |
2017-07-28 17:06:29 | paul.moore | link | issue31072 messages |
2017-07-28 17:06:29 | paul.moore | create | |
|