From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (unknown [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id E70B11381FA for ; Tue, 27 May 2014 20:56:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C81DFE08B5; Tue, 27 May 2014 20:56:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 74663E08AE for ; Tue, 27 May 2014 20:56:45 +0000 (UTC) Received: from spoonbill.gentoo.org (unknown [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7FA8333F900 for ; Tue, 27 May 2014 20:56:44 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id CE52A182E2 for ; Tue, 27 May 2014 20:56:40 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1400953128.750ec49ff4858d2ad168c91c9c8d465bff30d3b6.dol-sen@gentoo> Subject: [gentoo-commits] proj/gentoo-keys:master commit in: gkeys/ X-VCS-Repository: proj/gentoo-keys X-VCS-Files: gkeys/config.py gkeys/seed.py X-VCS-Directories: gkeys/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 750ec49ff4858d2ad168c91c9c8d465bff30d3b6 X-VCS-Branch: master Date: Tue, 27 May 2014 20:56:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4fe63b18-0890-4a15-9280-5792d88706e2 X-Archives-Hash: d6c091ccf1b017ec878793d34857b8cd commit: 750ec49ff4858d2ad168c91c9c8d465bff30d3b6 Author: Pavlos Ratis gentoo org> AuthorDate: Thu May 22 16:21:17 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sat May 24 17:38:48 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=750ec49f create namedtuple with default mapping --- gkeys/config.py | 14 -------------- gkeys/seed.py | 4 +--- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/gkeys/config.py b/gkeys/config.py index 818f5b1..b20d5cd 100644 --- a/gkeys/config.py +++ b/gkeys/config.py @@ -184,20 +184,6 @@ class GKEY(namedtuple('GKEY', ['nick', 'name', 'keyid', 'longkeyid', result = data.split(self.list_separator) return result - def _unpack_dict(self, data): - values = [] - for attr in self._fields: - values.append(data[attr]) - return values - - def make_packed_dict(self, packed_dict): - '''Creates a new instance of Gkey from a dictionary - - @param packed_dict: data inside a dictionary - @return new GKEY instance containing the data - ''' - return GKEY._make(self._unpack_dict(packed_dict)) - def make_packed(self, packed_string): '''Creates a new instance of Gkey from the packed value string diff --git a/gkeys/seed.py b/gkeys/seed.py index aebf63d..ecbbf83 100644 --- a/gkeys/seed.py +++ b/gkeys/seed.py @@ -52,11 +52,9 @@ class Seeds(object): logger.debug("Seed: load; IOError occurred while loading file") self._error(err) return False - # initialize a dummy instance, so it can make new ones - gkey = GKEY._make([None,None,None,None,None,None]) for seed in seedlines.items(): #try: - self.seeds.append(gkey.make_packed_dict(seed[1])) + self.seeds.append(GKEY(**seed[1])) #except Exception as err: #logger.debug("Seed: load; Error splitting seed: %s" % seed) #logger.debug("Seed: load; ...............parts: %s" % str(parts))