From 58746226d4b36bc40de91d4d1dd283e9faaff639 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 12 Feb 2010 16:34:21 -0500 Subject: Use the Output tuple to determine the order of output The attributes displayed is now dependant upon their definition in a Param. This enhances that, giving some level of control over how the result is displayed to the user. This also fixes displaying group membership, including failures of adding/removing entries. All tests pass now though there is still one problem. We need to return the dn as well. Once that is fixed we just need to comment out all the dn entries in the tests and they should once again pass. --- ipalib/__init__.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'ipalib/__init__.py') diff --git a/ipalib/__init__.py b/ipalib/__init__.py index 83956e16..beaf0ab5 100644 --- a/ipalib/__init__.py +++ b/ipalib/__init__.py @@ -584,9 +584,9 @@ For example, say we setup a command like this: ... ... def execute(self, key, **options): ... items = dict( -... fruit='apple', -... pet='dog', -... city='Berlin', +... fruit=u'apple', +... pet=u'dog', +... city=u'Berlin', ... ) ... if key in items: ... return dict(result=items[key]) @@ -627,9 +627,9 @@ through the ``ipa`` script basically will do the following: ----------- show-items: ----------- - city = 'Berlin' - fruit = 'apple' - pet = 'dog' + city = u'Berlin' + fruit = u'apple' + pet = u'dog' ------- 3 items ------- @@ -641,9 +641,9 @@ Similarly, calling it with ``reverse=True`` would result in the following: ----------- show-items: ----------- - pet = 'dog' - fruit = 'apple' - city = 'Berlin' + pet = u'dog' + fruit = u'apple' + city = u'Berlin' -------------------------- 3 items (in reverse order) -------------------------- @@ -652,7 +652,7 @@ Lastly, providing a ``key`` would result in the following: >>> result = api.Command.show_items(u'city') >>> api.Command.show_items.output_for_cli(textui, result, 'city', reverse=False) -city = 'Berlin' +city = u'Berlin' See the `ipalib.cli.textui` plugin for a description of its methods. -- cgit