gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-donations] branch master updated: qrcode


From: gnunet
Subject: [GNUnet-SVN] [taler-donations] branch master updated: qrcode
Date: Thu, 29 Aug 2019 19:15:12 +0200

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

dold pushed a commit to branch master
in repository donations.

The following commit(s) were added to refs/heads/master by this push:
     new 8ef2843  qrcode
8ef2843 is described below

commit 8ef2843d05d57c07115dba494cc913efc3f19014
Author: Florian Dold <address@hidden>
AuthorDate: Thu Aug 29 19:15:09 2019 +0200

    qrcode
---
 setup.py                              | 2 +-
 talerdonations/donations/donations.py | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 906567c..042635f 100755
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ setup(
     author_email=['address@hidden', 'address@hidden'],
     license='GPL',
     packages=find_packages(),
-    install_requires=["Flask>=0.10", "requests", "uwsgi", "jsmin"],
+    install_requires=["Flask>=0.10", "requests", "uwsgi", "jsmin", "qrcode", 
"lxml"],
     tests_require=["mock", "nose"],
     test_suite="nose.collector",
     package_data={
diff --git a/talerdonations/donations/donations.py 
b/talerdonations/donations/donations.py
index d4dd36d..c00844b 100644
--- a/talerdonations/donations/donations.py
+++ b/talerdonations/donations/donations.py
@@ -26,6 +26,9 @@ import random
 import requests
 import flask
 import traceback
+import qrcode
+import qrcode.image.svg
+import lxml.etree
 from ..talerconfig import TalerConfig
 
 LOGGER = logging.getLogger(__name__)
@@ -255,6 +258,12 @@ def check_status(order_id, session_id):
     return flask.jsonify(paid=pay_status["paid"])
 
 
+def get_qrcode_svg(data):
+    factory = qrcode.image.svg.SvgImage
+    img = qrcode.make(data, image_factory=factory)
+    return lxml.etree.tostring(img.get_image()).decode("utf-8")
+
+
 ##
 # Serve the fulfillment page.
 #

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



reply via email to

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