MCPcopy
hub / github.com/RUB-NDS/PRET / get

Method get

pcl.py:145–152  ·  view source on GitHub ↗
(self, path, size=None)

Source from the content-addressed store, hash-verified

143
144 # ------------------------[ get <file> ]------------------------------
145 def get(self, path, size=None):
146 pclfs = self.dirlist()
147 for name, (id, size, date) in list(pclfs.items()):
148 if path == name:
149 str_recv = self.retrieve_data(id)
150 return (int(size), str_recv)
151 print("File not found.")
152 return c.NONEXISTENT
153
154 def retrieve_data(self, id):
155 str_send = "&f" + id + "Y" # set macro id

Callers

nothing calls this directly

Calls 2

dirlistMethod · 0.95
retrieve_dataMethod · 0.95

Tested by

no test coverage detected