From f04aaff97c9c8c22b36706f2c6d4de6f23d06b95 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Wed, 12 Nov 2008 09:55:11 -0700 Subject: output_for_cli signature is now output_for_cli(textui, result, *args, **options) --- ipalib/frontend.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'ipalib/frontend.py') 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): """ -- cgit