remove unused GKEY code
authorPavlos Ratis <dastergon@gentoo.org>
Mon, 26 May 2014 19:25:34 +0000 (22:25 +0300)
committerPavlos Ratis <dastergon@gentoo.org>
Mon, 26 May 2014 19:25:34 +0000 (22:25 +0300)
gkeyldap/actions.py
gkeyldap/search.py
gkeys/config.py

index 7c0608bf08cf5c25094a356e084e10f7379c53f6..3de430807d251fb949848a949f0647ae3b14b710 100644 (file)
@@ -14,7 +14,6 @@ import os
 import re
 
 from collections import defaultdict
-from gkeys.config import GKEY
 from gkeys.seed import Seeds
 from gkeyldap.search import (LdapSearch, UID, gkey2ldap_map, gkey2SEARCH)
 
index 5f2ffbdcf5000b5ff0761be1cb1ad307bb13332a..c19a088055a4a0225d9227cab952bd100bee6a7e 100644 (file)
@@ -15,7 +15,6 @@ except ImportError:
 
 
 from gkeys import log
-from gkeys.config import GKEY
 
 logger = log.logger
 
index b932fb2e36a7294f28525769625499b5005a1147..14756e72030b84992512bb142ca03a1201415e05 100644 (file)
@@ -114,66 +114,6 @@ 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_separator = "|"
-    list_separator = ":"
+                   'longkeyid': list, 'keydir': str, 'fingerprint': list}
     __slots__ = ()
-
-    def _packed_values(self):
-        '''Returns a list of the field values'''
-        v = []
-        for f in self._fields:
-            v.append(self._pack(f))
-        return v
-
-    @property
-    def packed_string(self):
-        '''Returns a separator joined string of the field values'''
-        return self.field_separator.join([str(x) for x in self._packed_values()])
-
-    def _unpack_string(self, packed_data):
-        '''Returns a list of the separator joined string of the field values'''
-        values = []
-        data = packed_data.split(self.field_separator)
-        for x in self._fields:
-            values.append(self._unpack(x, data.pop(0)))
-        return values
-
-    def _pack(self, field):
-        '''pack field data into a string'''
-        if self.field_types[field] == str:
-            return getattr(self, field)
-        elif self.field_types[field] == list:
-            info = getattr(self, field)
-            if info:
-                return self.list_separator.join(info)
-            else:
-                # force an empty list to None
-                return 'None'
-        else:
-            raise "ERROR packing %s" %str(getattr(self, field))
-
-    def _unpack(self, field, data):
-        '''unpack field data to the desired type'''
-        if self.field_types[field] == str:
-            result = data
-            if result == 'None':
-                result = None
-        else:
-            if data == 'None':
-                # make it an empty list
-                result = []
-            else:
-                result = data.split(self.list_separator)
-        return result
-
-    def make_packed(self, packed_string):
-        '''Creates a new instance of Gkey from the packed
-        value string
-
-        @param packed_string: string of data separated by field_separator
-        @return new GKEY instance containing the data
-        '''
-        return GKEY._make(self._unpack_string(packed_string))