subclass __new__ to make both gkeys and gkeyldap work properly
authorPavlos Ratis <dastergon@gentoo.org>
Sat, 24 May 2014 17:26:19 +0000 (20:26 +0300)
committerPavlos Ratis <dastergon@gentoo.org>
Sat, 24 May 2014 17:38:48 +0000 (20:38 +0300)
gkeys/config.py

index b20d5cdc0321f0ac6af330a42325096077a01563..9d629b7f9ea939a043a54e8dc20fad923815ccbf 100644 (file)
@@ -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 = "|"