aboutsummaryrefslogtreecommitdiff
path: root/pyAggr3g470r.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyAggr3g470r.py')
-rwxr-xr-xpyAggr3g470r.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py
index 41911075..13ca2310 100755
--- a/pyAggr3g470r.py
+++ b/pyAggr3g470r.py
@@ -445,11 +445,14 @@ class Root:
pass
if not os.path.isfile("./var/qrcode/" + article_id + ".png"):
# QR Code generation
- if len(utils.clear_string(description)) < 4296:
+ try:
+ if len(utils.clear_string(description)) > 4296:
+ raise Exception()
f = qr.QRUrl(url = utils.clear_string(description))
- else:
+ f.make()
+ except:
f = qr.QRUrl(url = article.article_link)
- f.make()
+ f.make()
f.save("./var/qrcode/"+article_id+".png")
# Previous and following articles
bgstack15