Andrew Godwin committed 8dbd025

Basic cache skeleton - noop cache and making one per repo server

Comments (0)

Files changed (3)


 from heechee.webdav.commit import CommitMixin
 from import ReaderMixin
 from import FileStorage
+from heechee.webdav.caching.noop import NoopCache
 class DAVRequest(Request):
-    def __init__(self, repo):
+    def __init__(self, repo, cache=None, storage=None):
         self.repo = repo
- = FileStorage()
+        self.cache = cache or NoopCache()
+ = storage or FileStorage()
     def authorization_check(self, username, password, access_type):
Add a comment to this file


Empty file added.


+class NoopCache(object):
+    """
+    Simple noop cache - doesn't actually store any keys, and insists nothing
+    actually exists.
+    """
+    def __getitem__(self, key):
+        return KeyError("Key %r not found (noop)" % key)
+    def __setitem__(self, key, value):
+        return
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.