summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwillmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f>2008-09-16 16:37:51 +0000
committerwillmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f>2008-09-16 16:37:51 +0000
commit51e057b930a0d09484f3bd6a3ff359c0e40795ca (patch)
tree268f9222c5e33523f7ae086077f570c5c8d2115f
parent78228c13ed40a59b98aa649058a58b020056fb17 (diff)
downloadpyfilesystem-51e057b930a0d09484f3bd6a3ff359c0e40795ca.tar.gz
A few docs
git-svn-id: http://pyfilesystem.googlecode.com/svn/trunk@76 67cdc799-7952-0410-af00-57a81ceafa0f
-rw-r--r--fs/zipfs.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/zipfs.py b/fs/zipfs.py
index 18761be..3b163f2 100644
--- a/fs/zipfs.py
+++ b/fs/zipfs.py
@@ -14,6 +14,8 @@ import tempfs
class _TempWriteFile(object):
+ """Proxies a file object and calls a callback when the file is closed."""
+
def __init__(self, fs, filename, close_callback):
self.fs = fs
self.filename = filename
@@ -32,6 +34,8 @@ class _TempWriteFile(object):
class _ExceptionProxy(object):
+ """A placeholder for an object that may no longer be used."""
+
def __getattr__(self, name):
raise ValueError("Zip file has been closed")
@@ -43,7 +47,18 @@ class _ExceptionProxy(object):
class ZipFS(FS):
+ """A FileSystem that represents a zip file."""
+
def __init__(self, zip_file, mode="r", compression="deflated", allowZip64=False, thread_syncronize=True):
+ """Create a FS that maps on to a zip file.
+
+ zip_file -- A (system) path, or a file-like object
+ mode -- Mode to open zip file: 'r' for reading, 'w' for writing or 'a' for appending
+ compression -- Can be 'deflated' (default) to compress data or 'stored' to just store date
+ allowZip64 -- Set to True to use zip files greater than 2 MB, default is False
+ thread_syncronize -- Set to True (default) to enable thread-safety
+
+ """
FS.__init__(self, thread_syncronize=thread_syncronize)
if compression == "deflated":
compression_type = ZIP_DEFLATED