[Freeipa-devel] [PATCH] jderose 009 part 2 of limiting param to certain contexts
Jason Gerard DeRose
jderose at redhat.com
Thu May 21 20:10:30 UTC 2009
On Thu, 2009-05-21 at 14:34 -0400, Rob Crittenden wrote:
> Pavel Zuna wrote:
> > Jason Gerard DeRose wrote:
> >> This patch finishes my work to allow one to limit a parameter to only
> >> certain contexts, is the follow up to my 007 patch.
> >>
> >> This patch is fairly large but as far as I can tell is also totally
> >> benign: all the unit tests and doctests still pass (including the xmlrpc
> >> tests). Plus, as currently no plugins are using the `include` or
> >> `exclude` kwarg in their parameters, it should not change any high-level
> >> behavior.
> >>
> >> I renamed my `UsesParams` base class from the 007 patch to `HasParam`,
> >> from which now both `Command` and `Object` subclass. The context-based
> >> filtering is now enabled for the 'Command.args`, `Command.options`, and
> >> `Object.params` parameter namespaces.
> >>
> >> This patch includes docstrings that hopefully explain how this all
> >> works. Because the docstrings are much easier to read via the epydoc
> >> generated documentation, I built the documentation and uploaded it to my
> >> fedorapeople page:
> >>
> >> http://jderose.fedorapeople.org/freeipa2-dev-doc/
> >>
> >> For reviewing this patch, I would start with the Param.use_in_context()
> >> docstring:
> >>
> >> http://jderose.fedorapeople.org/freeipa2-dev-doc/ipalib.parameters.Param-class.html#use_in_context
> >>
> >>
> >> And then read the HasParam class docstring:
> >>
> >> http://jderose.fedorapeople.org/freeipa2-dev-doc/ipalib.frontend.HasParam-class.html
> >>
> >>
> >> I'll no doubt have additional small follow up patches soon, but I'd like
> >> to get this committed so we don't get too far out of sync.
> >
> > ack.
> >
> > Pavel
>
> Pushed to master.
>
> I also pushed the attached patch which resolves a couple of minor issues
> with it causing the build to break.
>
> rob
Thanks. I forgot to mention that I'm now raising a TypeError if
take_args, takes_options, or takes_params is a list instead of a tuple.
Rob requested this a long time ago and I finally got around to it.
More information about the Freeipa-devel
mailing list