From 3f5082c9c6d7f14bdc323f3e1970b6e05ad4e41d Mon Sep 17 00:00:00 2001 From: Daniel Fajt Date: Tue, 17 Sep 2024 13:20:31 -0700 Subject: [PATCH 1/2] fix #655: print plain username if not Anonymous --- keyring/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyring/cli.py b/keyring/cli.py index 8b3d712c..17852839 100644 --- a/keyring/cli.py +++ b/keyring/cli.py @@ -137,7 +137,7 @@ def _emit_json(self, credential: credentials.Credential): ) def _emit_plain(self, credential: credentials.Credential): - if credential.username: + if credential.username and not isinstance(credential, credentials.AnonymousCredential): print(credential.username) print(credential.password) From c34e444737ee858144181760dbb829b2f38b6415 Mon Sep 17 00:00:00 2001 From: Daniel Fajt Date: Tue, 17 Sep 2024 13:34:37 -0700 Subject: [PATCH 2/2] ruff --- keyring/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/keyring/cli.py b/keyring/cli.py index 17852839..57621af2 100644 --- a/keyring/cli.py +++ b/keyring/cli.py @@ -137,7 +137,9 @@ def _emit_json(self, credential: credentials.Credential): ) def _emit_plain(self, credential: credentials.Credential): - if credential.username and not isinstance(credential, credentials.AnonymousCredential): + if credential.username and not isinstance( + credential, credentials.AnonymousCredential + ): print(credential.username) print(credential.password)