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

Method get

pjl.py:232–245  ·  view source on GitHub ↗
(self, path, size=None)

Source from the content-addressed store, hash-verified

230
231 # ------------------------[ get <file> ]------------------------------
232 def get(self, path, size=None):
233 if not size:
234 size = self.file_exists(path)
235 if size != c.NONEXISTENT:
236 str_recv = self.cmd(
237 '@PJL FSUPLOAD NAME="' + path + '" OFFSET=0 SIZE=' + str(size),
238 True,
239 True,
240 True,
241 )
242 return (size, str_recv)
243 else:
244 print("File not found.")
245 return c.NONEXISTENT
246
247 # ------------------------[ put <local file> ]------------------------
248 def put(self, path, data):

Callers 7

do_getMethod · 0.45
do_catMethod · 0.45
verify_writeMethod · 0.45
verify_blindMethod · 0.45
ippMethod · 0.45
httpMethod · 0.45
httpsMethod · 0.45

Calls 2

file_existsMethod · 0.95
cmdMethod · 0.95

Tested by

no test coverage detected