From 61a8669eca86d0c07f8c16fe5717966f638fc63b Mon Sep 17 00:00:00 2001 From: facetoe Date: Sat, 14 Feb 2015 10:07:30 +0800 Subject: [PATCH] Removed POC NetrcBackend. --- i3pystatus/core/netrc_backend.py | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 i3pystatus/core/netrc_backend.py diff --git a/i3pystatus/core/netrc_backend.py b/i3pystatus/core/netrc_backend.py deleted file mode 100644 index c59ddfa..0000000 --- a/i3pystatus/core/netrc_backend.py +++ /dev/null @@ -1,25 +0,0 @@ -import os -from keyring.backend import KeyringBackend - - -# This is an example custom keyring backend. It should probably be somewhere else... -class NetrcBackend(KeyringBackend): - def get_password(self, service, username): - from netrc import netrc - sections = service.split('.') - setting = sections[-1] - if setting == 'password': - key = ".".join(sections[:-1]) - setting_tuple = netrc().authenticators(key) - if setting_tuple: - login, account, password = setting_tuple - return password - - def set_password(self, service, username, password): - raise Exception("Setting password not supported!") - - def priority(cls): - netrc_path = os.path.isfile(os.path.expanduser("~/.netrc")) - if not os.path.isfile(netrc_path): - raise Exception("No .netrc found at: %s" % netrc_path) - return 0.5