Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FilesystemStore: Add a size(key) method to return the file size on disk

  • Loading branch information...
commit ce4c9bda6ec5dc218d1690dc750f29678cecdc7c 1 parent ea6a9a8
@rslinckx authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 simplekv/fs.py
View
7 simplekv/fs.py
@@ -107,7 +107,12 @@ def keys(self):
def iter_keys(self):
return iter(self.keys())
-
+
+ def size(self, key):
+ self._check_valid_key(key)
+ if not key in self:
+ raise KeyError(key)
+ return os.stat(self._build_filename(key)).st_size
class WebFilesystemStore(FilesystemStore):
"""FilesystemStore that supports generating URLs suitable for web
Please sign in to comment.
Something went wrong with that request. Please try again.