summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/samples/store-gae/shopping-cart.py
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-07-17 22:44:52 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-07-17 22:44:52 +0000
commitc59c7ef6db1f5c6458109f0627a8853c7f162f80 (patch)
treeb2f9af2724b28f09746e9143ad12496206f8f838 /sca-cpp/trunk/samples/store-gae/shopping-cart.py
parentc8dd567ff6ea5b0fa2296b3819fb138e8ccc2b93 (diff)
Support the host property and a /logout URL on WSGI servers.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@965145 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/samples/store-gae/shopping-cart.py')
-rw-r--r--sca-cpp/trunk/samples/store-gae/shopping-cart.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/sca-cpp/trunk/samples/store-gae/shopping-cart.py b/sca-cpp/trunk/samples/store-gae/shopping-cart.py
index 04ad729585..8d369e3315 100644
--- a/sca-cpp/trunk/samples/store-gae/shopping-cart.py
+++ b/sca-cpp/trunk/samples/store-gae/shopping-cart.py
@@ -30,7 +30,7 @@ def getcart(id, cache):
return cart
# Post a new item to the cart, create a new cart if necessary
-def post(collection, item, cache, email):
+def post(collection, item, cache, host, email):
id = str(uuid.uuid1())
cart = ((item[0], id, item[2]),) + getcart(cartId, cache)
cache("put", (cartId,), cart)
@@ -46,13 +46,13 @@ def find(id, cart):
return find(id, cart[1:])
# Get items from the cart
-def get(id, cache, email):
+def get(id, cache, host, email):
if id == ():
return ("Your Cart", cartId) + getcart(cartId, cache)
return find(id[0], getcart(cartId, cache))
# Delete items from the cart
-def delete(id, cache, email):
+def delete(id, cache, host, email):
if id == ():
return cache("delete", (cartId,))
return True
@@ -68,11 +68,15 @@ def sum(items):
return price(items[0]) + sum(items[1:])
# Return the total price of the items in the cart
-def gettotal(cache, email):
+def gettotal(cache, host, email):
cart = getcart(cartId, cache)
return sum(cart)
# Return the email of the cart owner
-def getemail(cache, email):
+def getemail(cache, host, email):
return email()
+# Return the host that the app is running on
+def gethost(cache, host, email):
+ return host()
+