(gnupghome)
return True
Check if the keyring is already configured

    It is configured when:
    - It has at least one private key
    - It has at least two public keys
    - One of the public keys is the blocksat pubkey
Check if the keyring is already configured
Check if the keyring is already configured
def _is_gpg_keyring_set(gnupghome):
    """Check if the keyring is already configured

    It is configured when:
    - It has at least one private key
    - It has at least two public keys
    - One of the public keys is the blocksat pubkey

    """
    if not os.path.exists(gnupghome):
        return False

    gpg = Gpg(gnupghome)

    if (len(gpg.gpg.list_keys(True)) == 0):  # no private key
        return False

    if (len(gpg.gpg.list_keys()) < 2):  # no two public keys
        return False

    if (len(gpg.gpg.list_keys(
            keys=defs.blocksat_pubkey)) == 0):  # blocksat key
        return False

    return True
def _is_gpg_keyring_set ( gnupghome ) : if not os . path . exists ( gnupghome ) : return False gpg = Gpg ( gnupghome ) if ( len ( gpg . gpg . list_keys ( True ) ) == 0 ) : # no private key return False if ( len ( gpg . gpg . list_keys ( ) ) < 2 ) : # no two public keys return False if ( len ( gpg . gpg . list_keys ( keys = defs . blocksat_pubkey ) ) == 0 ) : # blocksat key return False return True