diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2009-05-20 15:19:09 -0600 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-05-21 14:32:45 -0400 |
commit | 7e58b29a92157fad40b50ef31f8c075b9dc363b7 (patch) | |
tree | 5f541cde18209bda0bd5df7c34365ce59d4c70b2 /ipalib/__init__.py | |
parent | 7b93f7bbd7d52132503a3c5691841c3e757616f9 (diff) | |
download | freeipa-7e58b29a92157fad40b50ef31f8c075b9dc363b7.tar.gz freeipa-7e58b29a92157fad40b50ef31f8c075b9dc363b7.tar.xz freeipa-7e58b29a92157fad40b50ef31f8c075b9dc363b7.zip |
Completed Param.use_in_context() functionality, which is now used by Command and Object
Diffstat (limited to 'ipalib/__init__.py')
-rw-r--r-- | ipalib/__init__.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ipalib/__init__.py b/ipalib/__init__.py index 7108f65e..4ad58d6e 100644 --- a/ipalib/__init__.py +++ b/ipalib/__init__.py @@ -409,9 +409,9 @@ For example: >>> class nudge(Command): ... """Takes one argument, one option""" ... -... takes_args = ['programmer'] +... takes_args = ('programmer',) ... -... takes_options = [Str('stuff', default=u'documentation')] +... takes_options = (Str('stuff', default=u'documentation')) ... ... def execute(self, programmer, **kw): ... return '%s, go write more %s!' % (programmer, kw['stuff']) @@ -462,7 +462,7 @@ here is a quick teaser: >>> from ipalib import Int >>> class create_player(Command): -... takes_options = [ +... takes_options = ( ... 'first', ... 'last', ... Str('nick', @@ -470,7 +470,7 @@ here is a quick teaser: ... default_from=lambda first, last: first[0] + last, ... ), ... Int('points', default=0), -... ] +... ) ... >>> cp = create_player() >>> cp.finalize() @@ -573,9 +573,9 @@ For example, say we setup a command like this: >>> class show_items(Command): ... -... takes_args = ['key?'] +... takes_args = ('key?',) ... -... takes_options = [Flag('reverse')] +... takes_options = (Flag('reverse'),) ... ... def execute(self, key, **options): ... items = dict( @@ -660,7 +660,7 @@ For example: >>> class paint_house(Command): ... -... takes_args = ['color'] +... takes_args = 'color' ... ... def execute(self, color): ... """Uses self.log.error()""" |