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 0348A1382F6 for ; Fri, 8 Jul 2016 15:37:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 064BEE0A86; Fri, 8 Jul 2016 15:37:51 +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 9F40DE0A86 for ; Fri, 8 Jul 2016 15:37:50 +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 8E0CA340E61 for ; Fri, 8 Jul 2016 15:37:49 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 104852444 for ; Fri, 8 Jul 2016 15:37:47 +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: <1467992138.3025811e5bbfd40a1a4e17ef5f305802cb545c22.dolsen@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/module_base.py X-VCS-Directories: pym/gentoolkit/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 3025811e5bbfd40a1a4e17ef5f305802cb545c22 X-VCS-Branch: master Date: Fri, 8 Jul 2016 15:37:47 +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: 5e7d3ff3-1ea6-4735-9403-0ea2d4e63d47 X-Archives-Hash: 009b4d4bffe82d827b847ad824268b74 commit: 3025811e5bbfd40a1a4e17ef5f305802cb545c22 Author: Brian Dolbec gentoo org> AuthorDate: Wed Jul 6 05:22:25 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Fri Jul 8 15:35:38 2016 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=3025811e module_base.py: Add a char type cli option capability This adds correct handling of the value being assigned to the class options. pym/gentoolkit/module_base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pym/gentoolkit/module_base.py b/pym/gentoolkit/module_base.py index 87e04f1..5182218 100644 --- a/pym/gentoolkit/module_base.py +++ b/pym/gentoolkit/module_base.py @@ -67,7 +67,6 @@ class ModuleBase(object): def parse_module_options(self, module_opts): """Parse module options and update self.options""" - opts = (x[0] for x in module_opts) posargs = (x[1] for x in module_opts) for opt, posarg in zip(opts, posargs): @@ -88,6 +87,8 @@ class ModuleBase(object): self.print_help(with_description=False) sys.exit(2) self.options[opt_name] = val + elif opt_type == 'char': + self.options[opt_name] = posarg def set_quiet(self, quiet): """sets the class option["quiet"] and option["verbose"] accordingly"""