Rewrite python-qrtools using python-qrencode instead of qrencode.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QR Tools |
In Progress
|
Wishlist
|
David Green |
Bug Description
Rewrite python-qrtools to use the python module 'qrencode' instead of accessing the program 'qrencode' with subprocess.
Also, redesign the library to make qr codes immutable (any modifications create a new object). They could be initialised in the following ways:
QR() #from default webcam
QR(webcam=...) #from video input device
QR(file=...) #from file
QR(image=...) #from pil image
QR(data=...) #from raw data
QR(data=..., type=...) #from data
and then methods could be called:
qr.
qr.
qr.
qr.
qr.get_data()
Also, the data type system could be cleaned up a lot by using objects or classes to represent types.
Changed in qr-tools: | |
milestone: | none → 2.1 |
Changed in qr-tools: | |
status: | New → In Progress |
I agree, we need to re-think and re-write qrtools, it is kind of messy right now. I like your proposal. In respect of data recognising / decoding we can use the code we are using right now for decoding phonebook data type (that I think you should rename meCard), this line in particular:
'phonebook': lambda data: dict(re. findall( "(.*?): (.*?);" , data.replace( "MECARD: ",""), re.IGNORECASE))
And, instead a dict we can return a list, because, for example, a meCard can have 2 "TEL:" entries. For example return:
[ ['N': 'Algozino Ramiro'], ['TEL', '1111111'], ['TEL', '2222222'], ['EMAIL', '<email address hidden>'] ]