summaryrefslogtreecommitdiffstats
path: root/Doc/library/zipapp.rst
diff options
context:
space:
mode:
authorPaul Moore <p.f.moore@gmail.com>2017-08-26 17:04:12 (GMT)
committerGitHub <noreply@github.com>2017-08-26 17:04:12 (GMT)
commit0780bf7578dc4c9c3852dc5e869aba515a2c65b1 (patch)
treedb073e0b76aabdb567564e917bc92239e5109f2b /Doc/library/zipapp.rst
parenta5b4ea15b61e3f3985f4f0748a18f8b888a63532 (diff)
downloadcpython-0780bf7578dc4c9c3852dc5e869aba515a2c65b1.zip
cpython-0780bf7578dc4c9c3852dc5e869aba515a2c65b1.tar.gz
cpython-0780bf7578dc4c9c3852dc5e869aba515a2c65b1.tar.bz2
bpo-31072: Rename the new filter argument for zipapp.create_archive. (#3049)
bpo-31072: Rename the new filter argument for zipapp.create_archive (GH-3049) * Rename the new argument to "filter" * Improve tests for the new functionality * Add a "What's New" entry.
Diffstat (limited to 'Doc/library/zipapp.rst')
-rw-r--r--Doc/library/zipapp.rst12
1 files changed, 8 insertions, 4 deletions
diff --git a/Doc/library/zipapp.rst b/Doc/library/zipapp.rst
index 993c2cc..120bbbb 100644
--- a/Doc/library/zipapp.rst
+++ b/Doc/library/zipapp.rst
@@ -99,7 +99,7 @@ The module defines two convenience functions:
.. function:: create_archive(source, target=None, interpreter=None, main=None,
- include_file=None)
+ filter=None)
Create an application archive from *source*. The source can be any
of the following:
@@ -144,9 +144,10 @@ The module defines two convenience functions:
contain a ``__main__.py`` file, as otherwise the resulting archive
would not be executable.
- The *include_file* argument specifies a callback function that is passed the
- relative path to the file in order to determine which files to store when
- being called against a directory.
+ The optional *filter* argument specifies a callback function that
+ is passed a Path object representing the path to the file being added
+ (relative to the source directory). It should return ``True`` if the
+ file is to be added.
If a file object is specified for *source* or *target*, it is the
caller's responsibility to close it after calling create_archive.
@@ -157,6 +158,9 @@ The module defines two convenience functions:
passed to the ``zipfile.ZipFile`` class, and must supply the methods
needed by that class.
+ .. versionadded:: 3.7
+ Added the *filter* argument.
+
.. function:: get_interpreter(archive)
Return the interpreter specified in the ``#!`` line at the start of the