From 4141af80341062e6b6db0b636a05988fa09e1f9f Mon Sep 17 00:00:00 2001 From: Pavlos Ratis Date: Sat, 24 May 2014 20:26:19 +0300 Subject: [PATCH] subclass __new__ to make both gkeys and gkeyldap work properly --- gkeys/config.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gkeys/config.py b/gkeys/config.py index b20d5cd..9d629b7 100644 --- a/gkeys/config.py +++ b/gkeys/config.py @@ -130,6 +130,13 @@ class GKEY(namedtuple('GKEY', ['nick', 'name', 'keyid', 'longkeyid', 'keydir', 'fingerprint'])): '''Class to hold the relavent info about a key''' + # subclass __new__ to make both gkeys and gkeyldap work properly + # delete it when keyid and longkeyid are removed from LDAP + def __new__(cls, nick=None, name=None, keydir=None, fingerprint=None, + keyid=None, longkeyid=None): + return super(GKEY, cls).__new__(cls, nick, name, keydir, fingerprint, + keyid, longkeyid) + field_types = {'nick': str, 'name': str, 'keyid': list, 'longkeyid': list, 'keydir': str, 'fingerprint': list} field_separator = "|" -- 2.26.2