@@ -39,6 +39,8 @@ class ZipFolder(DiskBasedFolderMixin, BaseFolder):
3939 def __init__ (self , * args , ** kargs ):
4040 """Initialise the file attribute."""
4141 self .File = None
42+ self .exclude = []
43+ self .flat = False
4244 super ().__init__ (* args , ** kargs )
4345
4446 @property
@@ -58,7 +60,7 @@ def key(self, value): # pylint: disable=invalid-overridden-method
5860 """Set the immediate filename that will be used when the file is saved."""
5961 self .path = pathjoin (self .directory , value )
6062
61- def _dialog (self , mode = "r" ):
63+ def _zip_file_dialog (self , mode = "r" ):
6264 """Create a file dialog box for working with.
6365
6466 Args:
@@ -94,7 +96,7 @@ def getlist(self, recursive=None, directory=None, flatten=None, **_):
9496 flatten = self .flat
9597
9698 if self .File is None and directory is None :
97- self .File = zf .ZipFile (self ._dialog (), "r" )
99+ self .File = zf .ZipFile (self ._zip_file_dialog (), "r" )
98100 close_me = True
99101 elif isinstance (directory , zf .ZipFile ):
100102 if directory .fp :
@@ -252,7 +254,7 @@ def save(self, root=None):
252254 A list of group paths in the Zip file
253255 """
254256 if root is None :
255- root = self ._dialog (mode = "w" )
257+ root = self ._zip_file_dialog (mode = "w" )
256258 elif isinstance (root , bool ) and not root and isinstance (self .File , zf .ZipFile ):
257259 root = self .File .filename
258260 self .File .close ()
@@ -261,14 +263,16 @@ def save(self, root=None):
261263 tmp = self .walk_groups (self ._save )
262264 return tmp
263265
264- def _save (self , f , trail ):
266+ def _save (self , f , trail , root = None ):
265267 """Create a virtual path of groups in the Zip file and save data.
266268
267269 Args:
268270 f(DataFile):
269271 A DataFile instance to save
270272 trail (list):
271273 The trail of groups
274+ root (string or None):
275+ a replacement root directory
272276
273277 Returns:
274278 The new filename of the saved DataFile.
0 commit comments