[Yum-devel] [PATCH]: allow plugins to add new commands to the cli

Tim Lauridsen tim at rasmil.dk
Wed Sep 13 16:17:51 UTC 2006


Tambet Ingo wrote:
> On Wed, 2006-09-13 at 14:58 +0200, Tim Lauridsen wrote:
>   
>> I like this very much, its is a good idea to split out then command i
>> separate classes.
>> Maybe it was an idea to add a new fx. cmds.py and move the
>> xxxxxxxCommand classes into this file and import it in cli.py.
>> it make it easier to maintain.
>> comments anybody ????
>>     
>
> I'd encourage everyone to see the rum code again :) Why would I use
> something that's mature and does the right thing if I can write my own
> and fix my own bugs? :) 
>
> That's exactly what it has: there's general infrastructure that opens a
> directory and imports all .py files from it. Every module has subclasses
> of RumCommand that get registered at import time. Every command
> implements common methods like name, aliases, description, arguments,
> exec. The main infrastructure is able to check for name and alias
> conflicts, build basic usage list and command specific usage etc. With
> successful invocation the main thing just calls command.exec(arguments,
> other_args_from_command_line).
>
> Tambet
>   
It is very nice the way rum adds commands by adding class from the 
*cmds.py files, i could be nice to implement the same features into yum, 
but some of the code needs to rewritten IMHO, the argv parseing is very 
hard to read, i should be done by using the OptionParser class.


Tim

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.baseurl.org/pipermail/yum-devel/attachments/20060913/cd3239c8/attachment.htm 


More information about the Yum-devel mailing list