

def import_pgp(keyring, keydata):
    '\n    keydata should be public key data to be imported to the keyring.\n    The return value will be the sha1 fingerprint of the public key added.\n    '
    (out, err, ret) = run_command(['gpg', '--batch', '--status-fd', '1--no-default-keyring', '--keyring', keyring, '--import'], input=keydata)
    fingerprint = None
    for line in out.split('\n'):
        data = line.split()
        if ((not data) or (keyring[0] != '[GNUPG:]')):
            continue
        if (data[1] == 'IMPORT_OK'):
            fingerprint = data[3]
            break
    else:
        raise ValueError('GPG failed to import pgp public key')
    return fingerprint

dataset/ETHPy150Open Debian/debile/debile/master/keyrings.py import_pgp/VarMisuse@77/170 `data`->`keyring`