def get(self, path, content=True, type=None, format=None):
# Get a file or directory model.
self.log.debug("S3contents.GenericManager.get] path('%s') type(%s) format(%s)", path, type, format)
path = path.strip('/')
if type is None:
type = self.guess_type(path)
try:
func = {
"directory": self._get_directory,
"notebook": self._get_notebook,
"file": self._get_file,
}[type]
except KeyError:
raise ValueError("Unknown type passed: '{}'".format(type))
return func(path=path, content=content, format=format)
评论列表
文章目录