Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def read(self, path):
key = self.as_key(path)
if not self.isfile(path):
raise NoSuchFile(self.as_path(key))
obj = self.resource.Object(self.bucket_name, key)
text = obj.get()["Body"].read().decode("utf-8")
return text
def lstat(self, path):
key = self.as_key(path)
if not self.isfile(path):
raise NoSuchFile(self.as_path(key))
obj = self.resource.Object(self.bucket_name, key)
info = {}
info["ST_MTIME"] = obj.last_modified
return info
def __init__(self, path, *args, **kwargs):
super(NoSuchFile, self).__init__(*args, **kwargs)
self.path = path