Gentoo Archives: gentoo-commits

From: Brian Dolbec <dolsen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/
Date: Fri, 08 Jul 2016 15:37:54
Message-Id: 1467992138.3025811e5bbfd40a1a4e17ef5f305802cb545c22.dolsen@gentoo
1 commit: 3025811e5bbfd40a1a4e17ef5f305802cb545c22
2 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 6 05:22:25 2016 +0000
4 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 8 15:35:38 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=3025811e
7
8 module_base.py: Add a char type cli option capability
9
10 This adds correct handling of the value being assigned to the class options.
11
12 pym/gentoolkit/module_base.py | 3 ++-
13 1 file changed, 2 insertions(+), 1 deletion(-)
14
15 diff --git a/pym/gentoolkit/module_base.py b/pym/gentoolkit/module_base.py
16 index 87e04f1..5182218 100644
17 --- a/pym/gentoolkit/module_base.py
18 +++ b/pym/gentoolkit/module_base.py
19 @@ -67,7 +67,6 @@ class ModuleBase(object):
20
21 def parse_module_options(self, module_opts):
22 """Parse module options and update self.options"""
23 -
24 opts = (x[0] for x in module_opts)
25 posargs = (x[1] for x in module_opts)
26 for opt, posarg in zip(opts, posargs):
27 @@ -88,6 +87,8 @@ class ModuleBase(object):
28 self.print_help(with_description=False)
29 sys.exit(2)
30 self.options[opt_name] = val
31 + elif opt_type == 'char':
32 + self.options[opt_name] = posarg
33
34 def set_quiet(self, quiet):
35 """sets the class option["quiet"] and option["verbose"] accordingly"""