gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant-frontend-examples] branch master updated (3


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant-frontend-examples] branch master updated (31f311e -> c628e37)
Date: Tue, 21 Feb 2017 16:41:42 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a change to branch master
in repository merchant-frontend-examples.

    from 31f311e  Completing tutorial code.
     new 9129afa  polishing code
     new c628e37  Fix fraction conversion

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Python/lib/pytaler/amounts.py | 2 +-
 Python/tutorial/tutorial.py   | 9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/Python/lib/pytaler/amounts.py b/Python/lib/pytaler/amounts.py
index 00f9ae4..0e7bbfe 100644
--- a/Python/lib/pytaler/amounts.py
+++ b/Python/lib/pytaler/amounts.py
@@ -29,7 +29,7 @@ def string_to_amount(fmt):
     currency = split[1]
     split = num.split(".")
     value = int(split[0])
-    fraction = int(split[1]) * FRACTION
+    fraction = float("0." + split[1]) * FRACTION
     return dict(value=value, fraction=fraction, currency=currency)
 
 
diff --git a/Python/tutorial/tutorial.py b/Python/tutorial/tutorial.py
index 9fa7575..be966bd 100644
--- a/Python/tutorial/tutorial.py
+++ b/Python/tutorial/tutorial.py
@@ -34,9 +34,9 @@ def index():
 
 @app.route("/donate")
 def donate():
-   resp = flask.Response(status=402)
-   resp.headers["X-Taler-Contract-Url"] = "/generate-contract"
-   return resp
+   response = flask.Response(status=402)
+   response.headers["X-Taler-Contract-Url"] = "/generate-contract"
+   return response
 
 
 @app.route("/generate-contract")
@@ -68,7 +68,7 @@ def generate_contract():
     r = requests.post(url, json=dict(order=order))
     if r.status_code != 200:
         logger.error("failed to POST to '%s'", url)
-        return r.status_code, r.text
+        return r.text, r.status_code
     proposal_resp = r.json()
     return flask.jsonify(**proposal_resp)
 
@@ -102,4 +102,3 @@ def pay():
     flask.session["paid"] = True
 
     return flask.Response(status=200)
-

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]