(self, key)
Import a GnuPG key and check that the operation was successful.
        :param str key: A string specifying the key's filepath from
            ``Common.paths``
        :rtype: bool
        :returns: ``True`` if the key is now within the keyring (or was
            previously and hasn't changed). ``False`` otherwise.
Import a GnuPG key and check that the operation was successful.
        :param str key: A string specifying the key's filepath from
            ``Common.paths``
        :rtype: bool
        :returns: ``True`` if the key is now within the keyring (or was
            previously and hasn't changed). ``False`` otherwise.
Import a GnuPG key and check that the operation was successful . : param str key : A string specifying the key s filepath from Common . paths : rtype : bool : returns : True if the key is now within the keyring ( or was previously and hasn t changed ) . False otherwise .
def import_key_and_check_status(self, key):
        """Import a GnuPG key and check that the operation was successful.
        :param str key: A string specifying the key's filepath from
            ``Common.paths``
        :rtype: bool
        :returns: ``True`` if the key is now within the keyring (or was
            previously and hasn't changed). ``False`` otherwise.
        """
        with gpg.Context() as c:
            c.set_engine_info(
                gpg.constants.protocol.OpenPGP, home_dir=self.paths["gnupg_homedir"]
            )

            impkey = self.paths["signing_keys"][key]
            try:
                c.op_import(gpg.Data(file=impkey))
            except:
                return False
            else:
                result = c.op_import_result()
                if result and self.fingerprints[key] in result.imports[0].fpr:
                    return True
                else:
                    return False
def import_key_and_check_status ( self , key ) : with gpg . Context ( ) as c : c . set_engine_info ( gpg . constants . protocol . OpenPGP , home_dir = self . paths [ "gnupg_homedir" ] ) impkey = self . paths [ "signing_keys" ] [ key ] try : c . op_import ( gpg . Data ( file = impkey ) ) except : return False else : result = c . op_import_result ( ) if result and self . fingerprints [ key ] in result . imports [ 0 ] . fpr : return True else : return False