many pep8 improvements
This commit is contained in:
1 parent
71ec15190b
commit
6aa5edc7ff
117 files changed
+7160
-5670
No files matched your search
@@ -1,5 +1,6 @@
|
||||
from gluon import XML
|
||||
|
||||
|
||||
def button(merchant_id="123456789012345",
|
||||
products=[dict(name="shoes",
|
||||
quantity=1,
|
||||
@@ -8,8 +9,8 @@ def button(merchant_id="123456789012345",
|
||||
description="running shoes black")]):
|
||||
t = '<input name="item_%(key)s_%(k)s" type="hidden" value="%(value)s"/>'
|
||||
list_products = ''
|
||||
for k,product in enumerate(products):
|
||||
for key,value in product.items():
|
||||
list_products += t % dict(k=k+1,key=key,value=value)
|
||||
for k, product in enumerate(products):
|
||||
for key, value in product.items():
|
||||
list_products += t % dict(k=k + 1, key=key, value=value)
|
||||
button = '<form action="https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/%s" id="BB_BuyButtonForm" method="post" name="BB_BuyButtonForm" target="_top">%s<input name="_charset_" type="hidden" value="utf-8"/><input alt="" src="https://checkout.google.com/buttons/buy.gif?merchant_id=%s&w=117&h=48&style=white&variant=text&loc=en_US" type="image"/></form>' % (merchant_id, list_products, merchant_id)
|
||||
return XML(button)
|
||||
Reference in new issue
Block a user