@@ -83,6 +83,7 @@ class MissingZipPathInfo:
83
83
"""
84
84
PathInfo implementation that is used when a zip file member is missing.
85
85
"""
86
+ __slots__ = ()
86
87
87
88
def exists (self , follow_symlinks = True ):
88
89
return False
@@ -195,12 +196,12 @@ class ZipFileList:
195
196
tree of `ZipPathInfo` objects representing the zip file members.
196
197
"""
197
198
198
- __slots__ = ('root ' , '_items' )
199
+ __slots__ = ('tree ' , '_items' )
199
200
200
- def __init__ (self , zip_file , items ):
201
- self .root = ZipPathInfo (zip_file )
201
+ def __init__ (self , zip_file ):
202
+ self .tree = ZipPathInfo (zip_file )
202
203
self ._items = []
203
- for item in items :
204
+ for item in zip_file . filelist :
204
205
self .append (item )
205
206
206
207
def __len__ (self ):
@@ -211,7 +212,7 @@ def __iter__(self):
211
212
212
213
def append (self , item ):
213
214
self ._items .append (item )
214
- self .root .resolve (item .filename , create = True ).zip_info = item
215
+ self .tree .resolve (item .filename , create = True ).zip_info = item
215
216
216
217
217
218
class ReadableZipPath (pathlib .types ._ReadablePath ):
@@ -226,7 +227,7 @@ def __init__(self, *pathsegments, zip_file):
226
227
self ._segments = pathsegments
227
228
self .zip_file = zip_file
228
229
if not isinstance (zip_file .filelist , ZipFileList ):
229
- zip_file .filelist = ZipFileList (zip_file , zip_file . filelist )
230
+ zip_file .filelist = ZipFileList (zip_file )
230
231
231
232
def __hash__ (self ):
232
233
return hash ((str (self ), self .zip_file ))
@@ -249,8 +250,8 @@ def with_segments(self, *pathsegments):
249
250
250
251
@property
251
252
def info (self ):
252
- root = self .zip_file .filelist .root
253
- return root .resolve (str (self ), follow_symlinks = False )
253
+ tree = self .zip_file .filelist .tree
254
+ return tree .resolve (str (self ), follow_symlinks = False )
254
255
255
256
def __open_rb__ (self , buffering = - 1 ):
256
257
info = self .info .resolve ()
0 commit comments