summaryrefslogtreecommitdiffstats
path: root/Doc/library/zipfile.rst
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2013-10-21 01:59:23 (GMT)
committerChristian Tismer <tismer@stackless.com>2013-10-21 01:59:23 (GMT)
commit59202e5fc77ae16c08e55decf8c0e71657650bb4 (patch)
treefbef602d428081ecc5d5ca5d50f9227e9189de05 /Doc/library/zipfile.rst
parent47f1b762fdfab90ecc4744cd9f6ea590ddb922c3 (diff)
downloadcpython-59202e5fc77ae16c08e55decf8c0e71657650bb4.zip
cpython-59202e5fc77ae16c08e55decf8c0e71657650bb4.tar.gz
cpython-59202e5fc77ae16c08e55decf8c0e71657650bb4.tar.bz2
add a filterfunc to zip file.PyZipFile.writepy, issue 19274
Diffstat (limited to 'Doc/library/zipfile.rst')
-rw-r--r--Doc/library/zipfile.rst10
1 files changed, 8 insertions, 2 deletions
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst
index 1c81262..3ca20de 100644
--- a/Doc/library/zipfile.rst
+++ b/Doc/library/zipfile.rst
@@ -382,7 +382,10 @@ The :class:`PyZipFile` constructor takes the same parameters as the
Instances have one method in addition to those of :class:`ZipFile` objects:
- .. method:: PyZipFile.writepy(pathname, basename='')
+ .. method:: PyZipFile.writepy(pathname, basename='', filterfunc=None)
+
+ .. versionadded:: 3.4
+ The *filterfunc* parameter.
Search for files :file:`\*.py` and add the corresponding file to the
archive.
@@ -404,7 +407,10 @@ The :class:`PyZipFile` constructor takes the same parameters as the
package directory, then all :file:`\*.py[co]` are added under the package
name as a file path, and if any subdirectories are package directories,
all of these are added recursively. *basename* is intended for internal
- use only. The :meth:`writepy` method makes archives with file names like
+ use only. When *filterfunc(pathname)* is given, it will be called for every
+ invocation. When it returns a False value, that path and its subpaths will
+ be ignored.
+ The :meth:`writepy` method makes archives with file names like
this::
string.pyc # Top level name