Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2169)

Unified Diff: appengine/findit_mock/libs/cache/cache.py

Issue 2447253002: [Findit & Predator] Code reorg of Findit. (Closed)
Patch Set: Clean up. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/findit_mock/libs/cache/cache.py
diff --git a/appengine/findit_mock/libs/cache/cache.py b/appengine/findit_mock/libs/cache/cache.py
new file mode 100644
index 0000000000000000000000000000000000000000..fdcfe0f9b4a147438436e4e3c08d11cc0e4dc901
--- /dev/null
+++ b/appengine/findit_mock/libs/cache/cache.py
@@ -0,0 +1,13 @@
+import functools
Sharu Jiang 2016/11/04 18:39:46 I think some part of cache is gae related, like *M
stgao 2016/11/08 18:53:32 Yes, that's the plan.
+
+def Cached():
+ def Decorator(func):
+ """Decorator to cache a function's results."""
+ @functools.wraps(func)
+ def Wrapped(*args, **kwargs):
+ # TODO: cache result.
+ return func(*args, **kwargs)
+
+ return Wrapped
+
+ return Decorator

Powered by Google App Engine
This is Rietveld 408576698