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

Menno Smits menno-yum at freshfoo.com
Thu Sep 14 05:51:28 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).

rum's way of implementing commands is nice and is similar to how yum's 
plugins work.

That said, what's the point of using such a system for yum commands? 
Once Bastiaan's patch goes in plugins will be able to cleanly extend 
yum's commands. Why have yet another directory and infrastructure to 
dynamically extend yum's commands when we already have an established 
plugin architecture that will be able to do it. It really doesn't buy us 
anything.

Menno



More information about the Yum-devel mailing list