From 95c14136bdb36bc8a23f68b2a4a118302b02919b Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Tue, 27 May 2014 19:20:12 -0700 Subject: [PATCH] gkeys/config.py: Add keyid property to GKEY Remove no longer tracked keyid and longkeyid from field_types --- gkeys/config.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gkeys/config.py b/gkeys/config.py index efb9be7..6941368 100644 --- a/gkeys/config.py +++ b/gkeys/config.py @@ -115,6 +115,11 @@ class GKeysConfig(GPGConfig): class GKEY(namedtuple('GKEY', ['nick', 'name', 'keydir', 'fingerprint'])): '''Class to hold the relavent info about a key''' - field_types = {'nick': str, 'name': str, 'keyid': list, - 'longkeyid': list, 'keydir': str, 'fingerprint': list} + field_types = {'nick': str, 'name': str, 'keydir': str, 'fingerprint': list} __slots__ = () + + + @property + def keyid(self): + '''Keyid is a substring value of the fingerprint''' + return ['0x' + x[-16:] for x in self.fingerprint] -- 2.26.2