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

Side by Side Diff: appengine/findit/libs/cache_decorator.py

Issue 2538373003: [Culprit-Finder] Merge lib/ to libs/. (Closed)
Patch Set: Rebase and fix nits. Created 4 years 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 unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """This module provides a decorator to cache the results of a function. 5 """This module provides a decorator to cache the results of a function.
6 6
7 Examples: 7 Examples:
8 1. Decorate a function: 8 1. Decorate a function:
9 @cache_decorator.Cached() 9 @cache_decorator.Cached()
10 def Test(a): 10 def Test(a):
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 except Exception: # pragma: no cover. 127 except Exception: # pragma: no cover.
128 logging.exception( 128 logging.exception(
129 'Failed to cache data for function %s.%s, args=%s, kwargs=%s', 129 'Failed to cache data for function %s.%s, args=%s, kwargs=%s',
130 func.__module__, func.__name__, repr(args), repr(kwargs)) 130 func.__module__, func.__name__, repr(args), repr(kwargs))
131 131
132 return result 132 return result
133 133
134 return Wrapped 134 return Wrapped
135 135
136 return Decorator 136 return Decorator
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698