def parse_private_key_file(args, key_list):
    wif_re = re.compile('[1-9a-km-zA-LMNP-Z]{51,111}')
    for f in args.private_key_file:
        if f.name.endswith('.gpg'):
            f = replace_with_gpg_pipe(args, f)
        for line in f.readlines():
            if isinstance(line, bytes):
                line = line.decode('utf8')
            possible_keys = wif_re.findall(line)

            def make_key(x):
                try:
                    return Key.from_text(x)
                except Exception:
                    return None
            keys = [make_key(x) for x in possible_keys]
            for key in keys:
                if key:
                    key_list.append((k.wif() for k in key.subkeys('')))
def parse_private_key_file(args, key_list):
    wif_re = re.compile('[1-9a-km-zA-LMNP-Z]{51,111}')
    for f in args.private_key_file:
        if f.name.endswith('.gpg'):
            f = replace_with_gpg_pipe(args, f)
        for line in f.readlines():
            if isinstance(line, bytes):
                line = line.decode('utf8')
            possible_keys = wif_re.findall(line)

            def make_key(x):
                try:
                    return Key.from_text(x)
                except Exception:
                    return None
            keys = [make_key(x) for x in possible_keys]
            for key in keys:
                if key:
                    key_list.append((k.wif() for k in key.subkeys()))