code: def OnNewGpgKey(self, event):
          
  
          if gnupg is None:
              return
  
          if genkey is None:
              # gnupg is not present
              self.interfaces.display_warning(
                  _("Python gnupg not found. No key selected."),
                  _("Key selection failed."))
          else:
              # gnupg is present
              genkey()
docs: New GPG key event handler.
  
          Launches GPG choice and creation dialog