Ejemplo n.º 1
0
 def parse_qr(self, screenshot):
     data = b64decode(screenshot['data'])
     image = PixelImage(data, screenshot['width'], screenshot['height'])
     for qr in qrparse.parse_qr_codes(image, 2):
         try:
             return success(
                 credential_data_to_dict(
                     CredentialData.from_uri(qrdecode.decode_qr_data(qr))))
         except Exception as e:
             logger.error('Failed to parse uri', exc_info=e)
             return failure('failed_to_parse_uri')
     return failure('no_credential_found')
Ejemplo n.º 2
0
 def parse_qr(self, screenshot):
     data = b64decode(screenshot["data"])
     image = PixelImage(data, screenshot["width"], screenshot["height"])
     for qr in qrparse.parse_qr_codes(image, 2):
         try:
             return success(
                 credential_data_to_dict(
                     CredentialData.parse_uri(qrdecode.decode_qr_data(qr))
                 )
             )
         except Exception as e:
             logger.error("Failed to parse uri", exc_info=e)
             return failure("failed_to_parse_uri")
     return failure("no_credential_found")
Ejemplo n.º 3
0
 def parse_qr(self, screenshot):
     data = b64decode(screenshot['data'])
     image = PixelImage(data, screenshot['width'], screenshot['height'])
     for qr in qrparse.parse_qr_codes(image, 2):
         return credential_data_to_dict(
             CredentialData.from_uri(qrdecode.decode_qr_data(qr)))
Ejemplo n.º 4
0
 def parse_qr(self, screenshot):
     data = b64decode(screenshot['data'])
     image = PixelImage(data, screenshot['width'], screenshot['height'])
     for qr in qrparse.parse_qr_codes(image, 2):
         return parse_uri(qrdecode.decode_qr_data(qr))
Ejemplo n.º 5
0
 def parse_qr(self, screenshot):
     data = b64decode(screenshot['data'])
     image = PixelImage(data, screenshot['width'], screenshot['height'])
     for qr in qrparse.parse_qr_codes(image, 2):
         return credential_data_to_dict(
             CredentialData.from_uri(qrdecode.decode_qr_data(qr)))