[Ml-yokadi] yokadi upstream

Sébastien Renard Sebastien.Renard
Mer 19 Nov 16:47:55 CET 2008


Le mercredi 19 novembre 2008, Aurélien Gâteau a écrit :
> Sébastien Renard wrote:
> > Le mardi 18 novembre 2008, Aurélien Gâteau a écrit :
> >>> Good. Did you implement it in common class in order to make it  «
> >>> transparent » for all commands ?
> >>
> >> Hum... no, there is no common class anymore :/.
> >
> > I see ;-)
> >
> >> The parser needs to be
> >> explicitly instantiated because you need to add your command options to
> >> it.
> >
> > Ok. It would be cool to generate command help directly from parser
> > definition to avoid repeating ourselves.
>
> Would be nice, but I am not sure how to get the docstring to execute
> some code :/

docstring can be get or set via the __doc__ attribute of each function.

Another way of generating command help is to define help_foo function for the 
do_foo function. This mechanism is done by the Cmd class.

Anyway, I think we will have to centralize a little bit parser definitions.

a+
-- 
Sébastien


Plus d'informations sur la liste de diffusion Ml-yokadi