From: Brian Dolbec Date: Wed, 28 May 2014 02:20:12 +0000 (-0700) Subject: gkeys/config.py: Add keyid property to GKEY X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;ds=inline;p=gentoo-keys.git gkeys/config.py: Add keyid property to GKEY Remove no longer tracked keyid and longkeyid from field_types --- 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]