Comment 1 for bug 807756

Revision history for this message
Ramiro Algozino (algozino) wrote :

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>'] ]