def do_get(self, line):
'''
Command: get
Description:
Get (copy) a file, or parts of file, from the sensor.
Args:
get [OPTIONS] <RemotePath> <LocalPath>
where OPTIONS are:
-o, --offset : The offset to start getting the file at
-b, --bytes : How many bytes of the file to get. The default is all bytes.
'''
self._needs_attached()
p = CliArgs(usage='get [OPTIONS] <RemoteFile> <LocalFile>')
(opts, args) = p.parse_line(line)
if len(args) != 2:
raise CliArgsException("Wrong number of args to get command")
with open(args[1], "wb") as fout:
gfile = self._file_path_fixup(args[0])
shutil.copyfileobj(self.lr_session.get_raw_file(gfile), fout)
评论列表
文章目录