diff options
author | cedricbonhomme <devnull@localhost> | 2011-11-25 10:45:23 +0100 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2011-11-25 10:45:23 +0100 |
commit | fc6d03a08c3d7c9a704f31d2b07f4fba2f9a01bc (patch) | |
tree | 508a2c1368ebc69e3dc2ea8a54f35da97891d156 /pyAggr3g470r.py | |
parent | Removed delicious share button in favor of pinboard. Removed twitter button. (diff) | |
download | newspipe-fc6d03a08c3d7c9a704f31d2b07f4fba2f9a01bc.tar.gz newspipe-fc6d03a08c3d7c9a704f31d2b07f4fba2f9a01bc.tar.bz2 newspipe-fc6d03a08c3d7c9a704f31d2b07f4fba2f9a01bc.zip |
Minor improvement. Ensure that the size of the string to encode is less than 4296 characters. Else the URL of the article is used. Catch all type of exceptions.
Diffstat (limited to 'pyAggr3g470r.py')
-rwxr-xr-x | pyAggr3g470r.py | 9 |
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 |