Example #1
0
 def createArchive(self, path, accumulator, **kwargs):
     """
     get the zip file object
     """
     dataExtractor = IDataExtractor(self.context)
     if dataExtractor and IArchivable.providedBy(self.context):
         data = dataExtractor.getData(**kwargs)
         if path:
           filepath = '%s/%s' % (path, self.context.getId())
         else:
           filepath = self.context.getId()
         accumulator.setFile(filepath,data)
Example #2
0
 def createArchive(self, path, accumulator, **kwargs):
     """
     get the archive file object
     """
     recursive = kwargs.get('recursive',1)
     adapter = IFilterFolder(self.context)
     for item in adapter.listObjects():
         if IArchivable.providedBy(item):
             archiver = IArchiver(item)
             folderish = isinstance(archiver,FolderishArchiver)
             if path:
                 cpath = '%s/%s' % (path, self.context.getId())
             else:
                 cpath = self.context.getId()
             if (recursive and folderish) or not folderish:
                 archiver.createArchive(cpath, accumulator, **kwargs)