From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 99AE2139085 for ; Sat, 24 Dec 2016 04:52:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6E825E0BC1; Sat, 24 Dec 2016 04:52:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3B826E0BC1 for ; Sat, 24 Dec 2016 04:52:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8F5E7340C97 for ; Sat, 24 Dec 2016 04:52:43 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B86CB24B0 for ; Sat, 24 Dec 2016 04:52: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: <1482555115.c1cf82a2f2f651da4749065be050154f23e07469.dolsen@gentoo> Subject: [gentoo-commits] proj/gentoo-keys:master commit in: gkeys/gkeys/ X-VCS-Repository: proj/gentoo-keys X-VCS-Files: gkeys/gkeys/actions.py X-VCS-Directories: gkeys/gkeys/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: c1cf82a2f2f651da4749065be050154f23e07469 X-VCS-Branch: master Date: Sat, 24 Dec 2016 04:52: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: 4c50e34a-cb1d-41a7-8e1d-2f386bce6a12 X-Archives-Hash: 70666dbd26d68a90f6b15834326aac71 commit: c1cf82a2f2f651da4749065be050154f23e07469 Author: Brian Dolbec gentoo org> AuthorDate: Sat Dec 24 04:51:55 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sat Dec 24 04:51:55 2016 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=c1cf82a2 gkeys actions: Migrate self.category setting to _set_category() gkeys/gkeys/actions.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py index 07dba7a..a9d2b69 100644 --- a/gkeys/gkeys/actions.py +++ b/gkeys/gkeys/actions.py @@ -108,6 +108,7 @@ class Actions(ActionBase): if args.uid is None: args.uid = [] gkey = self.seedhandler.new(args, checkgkey=True) + self._set_category(args.category) if not gkey: return (False, ["Failed to create a valid GKEY instance.", "Check for invalid data entries"]) @@ -198,7 +199,7 @@ class Actions(ActionBase): # fill in code here if not args.category: args.category = 'gentoo' - self.category = args.category + self._set_category(args.category) if args.keydir: self.gpg.set_keydir(args.keydir, "list-keys") self.gpg.set_keyseedfile() @@ -267,7 +268,7 @@ class Actions(ActionBase): return (False, ["Search failed for search term"]) # get confirmation # fill in code here - self.category = args.category + self._set_category(args.category) for gkey in gkeys: self.gpg.set_keydir(gkey.keydir, "recv-keys") self.gpg.set_keyseedfile() @@ -325,7 +326,7 @@ class Actions(ActionBase): return (False, [_unicode("Please specify seeds category.")]) self.logger.debug(_unicode("ACTIONS: checkkey; args: %s") % _unicode(args)) seeds = self.seedhandler.load_category(args.category) - self.category = args.category + self._set_category(args.category) results = {} failed = defaultdict(list) kwargs = self.seedhandler.build_gkeydict(args) @@ -375,7 +376,7 @@ class Actions(ActionBase): return (False, ["Please specify seeds category."]) self.logger.debug(_unicode("ACTIONS: speccheck; args: %s") % _unicode(args)) - self.category = args.category + self._set_category(args.category) catdir, keyresults = self.keyhandler.determine_keys(args) self.logger.debug(_unicode("ACTIONS: speccheck; catdir = %s") % catdir) results = {} @@ -524,6 +525,7 @@ class Actions(ActionBase): self.logger.debug(_unicode("ACTIONS: removekey; kwargs: %s") % _unicode(kwargs)) seeds = self.seedhandler.load_category(args.category) + self._set_category(args.category) messages = [] if args.nick == '*': self.output([''],_unicode('Remove All keys in category: %s') @@ -620,9 +622,9 @@ class Actions(ActionBase): '''Lists the installed key directories''' if args.category: keyring = self.config.get_key('keyring') - catdir = os.path.join(keyring, args.category) else: return (False, ["Please specify a category."]) + catdir = self._set_category(args.category) self.logger.debug("ACTIONS: installed; catdir = %s" % catdir) installed_keys = [] try: @@ -697,7 +699,7 @@ class Actions(ActionBase): def _verify(self, args, key, messages=None): if messages == None: messages = [] - self.category = args.category + self._set_category(args.category) filepath, signature = args.filename, args.signature timestamp_path = None isurl = success = verified = False @@ -831,9 +833,9 @@ class Actions(ActionBase): else: nicks = args.nick args.category = 'sign' + self._set_category(args.category) # load our installed signing keys db self.seeds = self.seedhandler.load_category('sign', nicks) - self.category = args.category if not self.seeds.seeds: return (False, ['No installed keys, try installkey action.', '']) keydir = self.config.get_key("sign", "keydir") @@ -877,7 +879,7 @@ class Actions(ActionBase): self.logger.debug(_unicode("ACTIONS: refreshkey; args: %s") % _unicode(args)) seeds = self.seedhandler.load_category(args.category, refresh=True) - self.category = args.category + self._set_category(args.category) results = {} kwargs = self.seedhandler.build_gkeydict(args) keyresults = seeds.list(**kwargs) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1B78D139085 for ; Sat, 24 Dec 2016 09:13:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F1F3B2340EF; Sat, 24 Dec 2016 09:13:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C199F2340EF for ; Sat, 24 Dec 2016 09:13:29 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id DC8613412B7 for ; Sat, 24 Dec 2016 09:13:18 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1A0F124EC for ; Sat, 24 Dec 2016 09:13:16 +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: <1482555115.c1cf82a2f2f651da4749065be050154f23e07469.dolsen@gentoo> Subject: [gentoo-commits] proj/gentoo-keys:gsoc-2016 commit in: gkeys/gkeys/ X-VCS-Repository: proj/gentoo-keys X-VCS-Files: gkeys/gkeys/actions.py X-VCS-Directories: gkeys/gkeys/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: c1cf82a2f2f651da4749065be050154f23e07469 X-VCS-Branch: gsoc-2016 Date: Sat, 24 Dec 2016 09:13:16 +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: e567b159-e919-452d-b99d-ce9016399530 X-Archives-Hash: a6f10f12a4648f37980947cb9b367a4e Message-ID: <20161224091316.Y6QPewh80oZqV3oyEeTNgMaWL4bLIaWrII05lS0U400@z> commit: c1cf82a2f2f651da4749065be050154f23e07469 Author: Brian Dolbec gentoo org> AuthorDate: Sat Dec 24 04:51:55 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sat Dec 24 04:51:55 2016 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=c1cf82a2 gkeys actions: Migrate self.category setting to _set_category() gkeys/gkeys/actions.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py index 07dba7a..a9d2b69 100644 --- a/gkeys/gkeys/actions.py +++ b/gkeys/gkeys/actions.py @@ -108,6 +108,7 @@ class Actions(ActionBase): if args.uid is None: args.uid = [] gkey = self.seedhandler.new(args, checkgkey=True) + self._set_category(args.category) if not gkey: return (False, ["Failed to create a valid GKEY instance.", "Check for invalid data entries"]) @@ -198,7 +199,7 @@ class Actions(ActionBase): # fill in code here if not args.category: args.category = 'gentoo' - self.category = args.category + self._set_category(args.category) if args.keydir: self.gpg.set_keydir(args.keydir, "list-keys") self.gpg.set_keyseedfile() @@ -267,7 +268,7 @@ class Actions(ActionBase): return (False, ["Search failed for search term"]) # get confirmation # fill in code here - self.category = args.category + self._set_category(args.category) for gkey in gkeys: self.gpg.set_keydir(gkey.keydir, "recv-keys") self.gpg.set_keyseedfile() @@ -325,7 +326,7 @@ class Actions(ActionBase): return (False, [_unicode("Please specify seeds category.")]) self.logger.debug(_unicode("ACTIONS: checkkey; args: %s") % _unicode(args)) seeds = self.seedhandler.load_category(args.category) - self.category = args.category + self._set_category(args.category) results = {} failed = defaultdict(list) kwargs = self.seedhandler.build_gkeydict(args) @@ -375,7 +376,7 @@ class Actions(ActionBase): return (False, ["Please specify seeds category."]) self.logger.debug(_unicode("ACTIONS: speccheck; args: %s") % _unicode(args)) - self.category = args.category + self._set_category(args.category) catdir, keyresults = self.keyhandler.determine_keys(args) self.logger.debug(_unicode("ACTIONS: speccheck; catdir = %s") % catdir) results = {} @@ -524,6 +525,7 @@ class Actions(ActionBase): self.logger.debug(_unicode("ACTIONS: removekey; kwargs: %s") % _unicode(kwargs)) seeds = self.seedhandler.load_category(args.category) + self._set_category(args.category) messages = [] if args.nick == '*': self.output([''],_unicode('Remove All keys in category: %s') @@ -620,9 +622,9 @@ class Actions(ActionBase): '''Lists the installed key directories''' if args.category: keyring = self.config.get_key('keyring') - catdir = os.path.join(keyring, args.category) else: return (False, ["Please specify a category."]) + catdir = self._set_category(args.category) self.logger.debug("ACTIONS: installed; catdir = %s" % catdir) installed_keys = [] try: @@ -697,7 +699,7 @@ class Actions(ActionBase): def _verify(self, args, key, messages=None): if messages == None: messages = [] - self.category = args.category + self._set_category(args.category) filepath, signature = args.filename, args.signature timestamp_path = None isurl = success = verified = False @@ -831,9 +833,9 @@ class Actions(ActionBase): else: nicks = args.nick args.category = 'sign' + self._set_category(args.category) # load our installed signing keys db self.seeds = self.seedhandler.load_category('sign', nicks) - self.category = args.category if not self.seeds.seeds: return (False, ['No installed keys, try installkey action.', '']) keydir = self.config.get_key("sign", "keydir") @@ -877,7 +879,7 @@ class Actions(ActionBase): self.logger.debug(_unicode("ACTIONS: refreshkey; args: %s") % _unicode(args)) seeds = self.seedhandler.load_category(args.category, refresh=True) - self.category = args.category + self._set_category(args.category) results = {} kwargs = self.seedhandler.build_gkeydict(args) keyresults = seeds.list(**kwargs)