html_form submit button is now a parameter
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Wed, 30 Jun 2010 22:58:00 +0200
changeset 9 39c1be3c4ed0
parent 8 42b28c015239
child 10 19ca11040e22
html_form submit button is now a parameter
cmcic.py
--- a/cmcic.py	Thu Jun 24 15:39:31 2010 +0200
+++ b/cmcic.py	Wed Jun 30 22:58:00 2010 +0200
@@ -255,7 +255,9 @@
     def is_valid_msg(self, msg, mac):
         return self.compute_hmac(msg) == mac.lower()
 
-def html_form(tpe, req, label):
+# by default submit = u'<input type="submit" name="bouton" id="bouton" value="%s" />' % label
+
+def html_form(tpe, req, submit):
     form = [u'<form action="%s" method="post" id="PaymentRequest">' % tpe.server_url]
     msg, mac = tpe.paymentrequest_msg(req)
     fields = [("version"         ,tpe.version),
@@ -274,7 +276,7 @@
               ]
     for name, value in fields:
 	form.append(u'<input type="hidden" name="%s" id="%s" value="%s" />' % (name, name, value))
-    form.append(u'<input type="submit" name="bouton" id="bouton" value="%s" />' % label)
+    form.append(submit)
     form.append(u'</form>')
     return u''.join(form)