launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #07734
Re: script_commands library
On 9 August 2011 01:27, Aaron Bentley <aaron@xxxxxxxxxxxxx> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 11-08-08 10:38 AM, Jamu Kakar wrote:
>> This sounds a lot like a library I wrote some time ago called
>> Commandant. It's a wrapper around bzrlib that let's you easily write
>> applications with a Bazaar-like user experience.
>
> It's not surprising, since I've done so much hacking on bzr. But I've
> long thought that the command classes of bzrlib were somewhat redundant,
> since they only exist to house the "run" method. I think that functions
> are a better match for subcommands. Unlike bzrlib, script_commands
> doesn't require declaring options or their types. It's just less friction.
fwiw I agree that them being objects is a bit unnecessary, and if I
was adding them now I would probably make them just functions. In
other languages wrapping function-like things in objects makes sense,
but I think not in Python.
Martin
References