From bb565c8c7d544c7e229e957ae78b13b3a1c65230 Mon Sep 17 00:00:00 2001 From: kdmukai Date: Wed, 3 Apr 2024 12:48:48 -0500 Subject: [PATCH] cleanup --- src/seedsigner/models/decode_qr.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/seedsigner/models/decode_qr.py b/src/seedsigner/models/decode_qr.py index 96412cccf..da5f25269 100644 --- a/src/seedsigner/models/decode_qr.py +++ b/src/seedsigner/models/decode_qr.py @@ -322,8 +322,6 @@ def extract_qr_data(image, is_binary:bool = False) -> str | None: for barcode in barcodes: # Only pull and return the first barcode return barcode.data - - print("No QR data") @staticmethod @@ -343,10 +341,10 @@ def detect_segment_type(s, wordlist_language_code=None): # PSBT if re.search("^UR:CRYPTO-PSBT/", s, re.IGNORECASE): return QRType.PSBT__UR2 - + elif re.search("^UR:CRYPTO-OUTPUT/", s, re.IGNORECASE): return QRType.OUTPUT__UR - + elif re.search("^UR:CRYPTO-ACCOUNT/", s, re.IGNORECASE): return QRType.ACCOUNT__UR @@ -368,10 +366,10 @@ def detect_segment_type(s, wordlist_language_code=None): elif re.search(r'^\{\"label\".*\"descriptor\"\:.*', desc_str, re.IGNORECASE): # if json starting with label and contains descriptor, assume specter wallet json return QRType.WALLET__SPECTER - + elif "multisig setup file" in s.lower(): return QRType.WALLET__CONFIGFILE - + elif "sortedmulti" in s: return QRType.WALLET__GENERIC @@ -398,7 +396,7 @@ def detect_segment_type(s, wordlist_language_code=None): _4LETTER_WORDLIST = [word[:4].strip() for word in wordlist] except: _4LETTER_WORDLIST = [] - + if all(x in wordlist for x in s.strip().split(" ")): # checks if all words in list are in bip39 word list return QRType.SEED__MNEMONIC @@ -414,7 +412,7 @@ def detect_segment_type(s, wordlist_language_code=None): # Probably this isn't meant to be string data; check if it's valid byte data # below. pass - + # Is it byte data? # 32 bytes for 24-word CompactSeedQR; 16 bytes for 12-word CompactSeedQR if len(s) == 32 or len(s) == 16: