MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / openArchive

Method openArchive

plugins/FilePack/FilePackPlugin.py:111–129  ·  view source on GitHub ↗
(self, inner_path)

Source from the content-addressed store, hash-verified

109 return super(SiteStoragePlugin, self).isFile(inner_path)
110
111 def openArchive(self, inner_path):
112 archive_path = self.getPath(inner_path)
113 file_obj = None
114 if archive_path not in archive_cache:
115 if not os.path.isfile(archive_path):
116 result = self.site.needFile(inner_path, priority=10)
117 self.site.updateWebsocket(file_done=inner_path)
118 if not result:
119 raise Exception("Unable to download file")
120 file_obj = self.site.storage.openBigfile(inner_path)
121 if file_obj == False:
122 file_obj = None
123
124 try:
125 archive = openArchive(archive_path, file_obj=file_obj)
126 except Exception as err:
127 raise Exception("Unable to download file: %s" % Debug.formatException(err))
128
129 return archive
130
131 def walk(self, inner_path, *args, **kwags):
132 if ".zip" in inner_path or ".tar.gz" in inner_path:

Callers 3

walkMethod · 0.95
listMethod · 0.95
readMethod · 0.95

Calls 5

openArchiveFunction · 0.85
getPathMethod · 0.80
openBigfileMethod · 0.80
needFileMethod · 0.45
updateWebsocketMethod · 0.45

Tested by

no test coverage detected