diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-11-12 09:55:11 -0700 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-11-12 09:55:11 -0700 |
commit | f04aaff97c9c8c22b36706f2c6d4de6f23d06b95 (patch) | |
tree | 64937c8d6f7d394f4c077585d124ecd0331b1f80 /ipalib/frontend.py | |
parent | 09161e399a61e2a548e9efb3c3abb2c7b47d5520 (diff) | |
download | freeipa-f04aaff97c9c8c22b36706f2c6d4de6f23d06b95.tar.gz freeipa-f04aaff97c9c8c22b36706f2c6d4de6f23d06b95.tar.xz freeipa-f04aaff97c9c8c22b36706f2c6d4de6f23d06b95.zip |
output_for_cli signature is now output_for_cli(textui, result, *args, **options)
Diffstat (limited to 'ipalib/frontend.py')
-rw-r--r-- | ipalib/frontend.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/ipalib/frontend.py b/ipalib/frontend.py index ce4168bc..56c4ea01 100644 --- a/ipalib/frontend.py +++ b/ipalib/frontend.py @@ -511,7 +511,7 @@ class Command(plugable.Plugin): 'options', 'params', 'args_to_kw', - 'kw_to_args', + 'params_2_args_options', 'output_for_cli', )) takes_options = tuple() @@ -536,8 +536,8 @@ class Command(plugable.Plugin): kw = self.convert(**kw) kw.update(self.get_default(**kw)) self.validate(**kw) - args = tuple(kw.pop(name) for name in self.args) - return self.run(*args, **kw) + (args, options) = self.params_2_args_options(kw) + return self.run(*args, **options) def args_to_kw(self, *values): """ @@ -569,11 +569,15 @@ class Command(plugable.Plugin): else: break - def kw_to_args(self, **kw): + def params_2_args_options(self, params): """ - Map keyword into positional arguments. + Split params into (args, kw). """ - return tuple(kw.get(name, None) for name in self.args) + args = tuple(params.get(name, None) for name in self.args) + options = dict( + (name, params.get(name, None)) for name in self.options + ) + return (args, options) def normalize(self, **kw): """ |