My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 3: Made it throw CodeOverflowException instead of regular Exception
  Back to list
Status:  New
Owner:  ----


 
Reported by pawel.de...@gmail.com, Mar 1, 2011
CodeOverflowException can be caught and typeNumber increased progressively until the data fits in the code. Example:

from PyQRNative import *

complete = False
qr_type = 1

while not complete:
    qr = QRCode(qr_type, QRErrorCorrectLevel.L)
    qr.addData("http://example.com/")

    try:
        qr.make()
    except CodeOverflowException:
        qr_type += 1
    else:
        complete = True
PyQRNative.py.patch
815 bytes   View   Download
Mar 1, 2011
#1 pawel.de...@gmail.com
I made a mistake in the patch. Line 7 should be:

+class CodeOverflowException(Exception):

Powered by Google Project Hosting