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

Side by Side Diff: chrome/common/extensions/docs/server2/in_memory_memcache.py

Issue 10823105: Extensions Docs Server: Preview server and more integration tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: previewserver -> preview + fixes Created 8 years, 4 months 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 class InMemoryMemcache(object):
6 """A memcache that stores items in memory instead of using the memcache
7 module.
8 """
9 def __init__(self):
10 self._cache = {}
11
12 def set(self, key, value, namespace, time=60):
13 if namespace not in self._cache:
14 self._cache[namespace] = {}
15 self._cache[namespace][key] = value
16
17 def get(self, key, namespace):
18 if namespace not in self._cache:
19 return None
20 return self._cache[namespace].get(key, None)
21
22 def delete(self, key, namespace):
23 if namespace in self._cache:
24 self._cache[namespace].pop(key)
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/handler.py ('k') | chrome/common/extensions/docs/server2/integration_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698