Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes
ATContentTypes.adapters.archive.ZipAccumulator Class Reference

List of all members.

Public Member Functions

def __init__
def setFile
def setZip
def close
def getRaw

Public Attributes

 context

Static Public Attributes

 sIO = None

Static Private Attributes

 _zip = None

Detailed Description

Implements an accumulator for zip files.
Note: This should be derived from a superclass allowing for other
compression types, and also for specific handling of object 
specific content - hence the object parameter.

Definition at line 78 of file archive.py.


Constructor & Destructor Documentation

Definition at line 89 of file archive.py.

00089 
00090     def __init__(self, context):
00091         self.context = context
00092         self.sIO = StringIO()
00093         self._zip = ZipFile(self.sIO,"w",8)


Member Function Documentation

close the zip file

Definition at line 109 of file archive.py.

00109 
00110     def close(self):
00111         """
00112         close the zip file
00113         """
00114         self._zip.close()

Here is the caller graph for this function:

return the raw zip file

Definition at line 115 of file archive.py.

00115 
00116     def getRaw(self):
00117         """
00118         return the raw zip file
00119         """
00120         if(self._zip):
00121             self.close()
00122             value = self.sIO.getvalue()
00123             self.setZip()
00124             return value
00125         else:
00126             raise BadRequest, "Unitialized Zip file"

Here is the call graph for this function:

def ATContentTypes.adapters.archive.ZipAccumulator.setFile (   self,
  filename,
  data 
)
store the file inside the zip file

Definition at line 94 of file archive.py.

00094 
00095     def setFile(self,filename,data):
00096         """
00097         store the file inside the zip file
00098         """
00099         if(self._zip):
00100             self._zip.writestr(filename,data)
00101         else:
00102             raise BadRequest, "Unitialized Zip file"

Here is the caller graph for this function:

initialize the zipe file

Definition at line 103 of file archive.py.

00103 
00104     def setZip(self):
00105         """
00106         initialize the zipe file
00107         """
00108         self._zip = ZipFile(self.sIO,"w",8)

Here is the caller graph for this function:


Member Data Documentation

Definition at line 86 of file archive.py.

Definition at line 90 of file archive.py.

Definition at line 87 of file archive.py.


The documentation for this class was generated from the following file: