MCPcopy Create free account
hub / github.com/ml-explore/mlx / ZipFileWrapper

Method ZipFileWrapper

python/src/load.cpp:56–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54class ZipFileWrapper {
55 public:
56 ZipFileWrapper(
57 const nb::module_& zipfile,
58 const nb::object& file,
59 char mode = 'r',
60 int compression = 0)
61 : zipfile_module_(zipfile),
62 zipfile_object_(zipfile.attr("ZipFile")(
63 file,
64 "mode"_a = mode,
65 "compression"_a = compression,
66 "allowZip64"_a = true)),
67 files_list_(zipfile_object_.attr("namelist")()),
68 open_func_(zipfile_object_.attr("open")),
69 read_func_(zipfile_object_.attr("read")),
70 close_func_(zipfile_object_.attr("close")) {}
71
72 std::vector<std::string> namelist() const {
73 return nb::cast<std::vector<std::string>>(files_list_);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected