6.21. foundations.pkzip

pkzip.py

Platform:
Windows, Linux, Mac Os X.
Description:
Provides archives files manipulation objects.

Others:

6.21.1. Module Attributes

foundations.pkzip.LOGGER

6.21.2. Classes

class foundations.pkzip.Pkzip(archive=None)[source]

Bases: object

Defines methods to manipulate zip files.

Initializes the class.

Usage:

>>> import tempfile
>>> tempDirectory = tempfile.mkdtemp()
>>> zipFile = Pkzip("zipFile.zip")
>>> zipFile.extract(tempDirectory)
True
Parameters:archive (unicode) – Archive to manipulate.
archive[source]

Property for self.__archive attribute.

Returns:self.__archive.
Return type:unicode
extract(target)[source]

Extracts the archive file to given directory.

Parameters:target (unicode) – Target extraction directory.
Returns:Method success.
Return type:bool