From c418a8193a4efa791654fb2027195977a49cc6f8 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Fri, 21 Jun 2013 18:40:42 -0700 Subject: [PATCH] Add nick field to GKEY class --- gkeys/config.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gkeys/config.py b/gkeys/config.py index 1daca70..3da1c21 100644 --- a/gkeys/config.py +++ b/gkeys/config.py @@ -17,6 +17,7 @@ from collections import namedtuple from pygpg.config import GPGConfig +from gkeys.log import logger from gkeys.utils import path @@ -74,7 +75,7 @@ class GKeysConfig(GPGConfig): self.configparser.read(defaults['config']) - def get_key(self, key): + def get_key(self, key, subkey=None): return self._get_(key) @@ -89,8 +90,8 @@ class GKeysConfig(GPGConfig): return None -class GKEY(namedtuple('GKEY', ['name', 'keyid', 'longkeyid', - 'fingerprint', 'keyring'])): +class GKEY(namedtuple('GKEY', ['nick', 'name', 'keyid', 'longkeyid', + 'keyring', 'fingerprint'])): '''Class to hold the relavent info about a key''' __slots__ = () @@ -102,7 +103,7 @@ class GKEY(namedtuple('GKEY', ['name', 'keyid', 'longkeyid', v.append(getattr(self, f)) return v - def value_string(self): + def value_string(self, separator=' '): '''Returns a space separated string of the field values''' - return ' '.join([str(x) for x in self.values()]) + return separator.join([str(x) for x in self.values()]) -- 2.26.2