def setup_keyring(keyring_name):
    '''Setup the keyring'''
    keyring_path = os.path.join("test", "outputdata", keyring_name)
    # Delete the entire keyring
    shutil.rmtree(keyring_path, ignore_errors=True)
    os.makedirs(keyring_path)
    gpg = GPG(gnupghome=keyring_path, gpgbinary="gpg")
    for key_name in ["key1_private", "key1_public"]:
        with open(os.path.join("test", "inputdata", key_name + ".txt"), "r") as keyfile:
            key_str = "".join(keyfile.readlines())
        import_result = gpg.import_keys(key_str)
        print("Import result:", type(import_result))
        print(import_result.__dict__)
        if import_result.count == 1 and len(set(import_result.fingerprints)) == 1:
            print("Got one import result")
    return gpg
def from_json(self, filename: str, silent: bool = False) -> bool:
        """Update the values in the config from a JSON file. The loaded
        data is passed to the :meth:`from_mapping` method.

        :param filename: The path to the JSON file. This can be an
            absolute path or relative to the config root path.
        :param silent: Ignore the file if it doesn't exist.

        .. deprecated:: 2.0.0
            Will be removed in Flask 2.1. Use :meth:`from_file` instead.
            This was removed early in 2.0.0, was added back in 2.0.1.

        .. versionadded:: 0.11
        """
        import warnings
        from . import json

        warnings.warn(
            "'from_json' is deprecated and will be removed in Flask"
            " 2.1. Use 'from_file(path, json.load)' instead.",
            DeprecationWarning,
            stacklevel=2,
        )
        return self.from_file(filename, json.load, silent=silent)