diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-02-20 07:20:38 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-02-20 07:20:38 +0000 |
commit | 1a01ce4fe5882fcc5b312172d7fdf409e0cb9765 (patch) | |
tree | a01683ba47a8cc7137700b3c33b5a7a14c153e2c /sca-cpp/trunk/hosting/server/store.py | |
parent | 3479cfa1585b752df58873b941b5bfd06a879b04 (diff) |
Fixes to the hosting module to correctly store ATOM feeds instead of raw collections and work with the sqldb component.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1291136 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-cpp/trunk/hosting/server/store.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sca-cpp/trunk/hosting/server/store.py b/sca-cpp/trunk/hosting/server/store.py index 014c07050e..930e8b3639 100644 --- a/sca-cpp/trunk/hosting/server/store.py +++ b/sca-cpp/trunk/hosting/server/store.py @@ -20,14 +20,18 @@ from util import * # Convert a particular store tag to a store id def storeid(tag): - return ("'store", "'" + tag, "'store.apps") + return ("store", tag, "store.apps") # Get a store from the cache def getstore(id, cache): - store = cache.get(id) - if isNil(store) or store is None: + val = cache.get(id) + if isNil(val) or val is None: return () - return store + return cdddr(car(val)) + +# Put a store into the cache +def putstore(id, store, cache): + val = ((("'feed", ("'title", "App Store"), ("'id", cadr(id))) + store),) # Put an app into a store def put(key, app, cache): @@ -40,7 +44,7 @@ def put(key, app, cache): tag = car(key) store = putapp(app, getstore(storeid(tag), cache)) - cache.put(storeid(tag), store) + putstore(storeid(tag), store, cache) return True # Get apps from a store @@ -75,6 +79,6 @@ def delete(key, cache): return cons(car(store), deleteapp(id, cdr(store))) store = deleteapp(id, getstore(storeid(tag), cache)) - cache.put(storeid(tag), store) + putstore(storeid(tag), store, cache) return True |