217
217
def has(self, relpath):
218
218
raise NotImplementedError("has() is abstract on %r" % self)
220
def get(self, relpath):
220
def get(self, relpath, hints={}):
221
221
"""Get the file at the given relative path.
223
223
:param relpath: The relative path to the file
224
:param hints: A dict of hints applicable to the get.
225
follow_redirections: False
226
will raise RedirectRequested instead of silently
227
following the redirections.
225
code, response_file = self._get(relpath, None)
229
code, response_file = self._get(relpath, None, hints=hints)
226
230
return response_file
228
def _get(self, relpath, ranges):
232
def _get(self, relpath, ranges, tail_amount=0, hints={}):
229
233
"""Get a file, or part of a file.
231
235
:param relpath: Path relative to transport base URL
232
:param byte_range: None to get the whole file;
236
:param ranges: None to get the whole file;
233
237
or [(start,end)] to fetch parts of a file.
238
:param tail_amount: to fetch that amount from file tail.
239
:param hints: A dict of hints (see get).
235
241
:returns: (http_code, result_file)