Plugin Experiences
Jonathan Lange
jml at mumak.net
Thu Jun 5 00:14:36 BST 2008
Hello all,
I've recently extended the 'loom' plugin to show the current thread in
the output of 'bzr status'.
Working with bzrlib is generally a pleasure. This time, however, there
were a couple of things that tripped me up:
1. Decorating commands is tricksy and undocumented.
See cmd_status in
http://bazaar.launchpad.net/~bzr-loom-devs/bzr-loom/trunk/annotate/head:/commands.py
for how I did it.
It would be nice if this were better documented. A better API would be nice too.
2. Should I use 'print'?
You'll notice that the commands.py file universally uses 'print' to
generate user output. In a private email I was told that this no
longer the done thing, and that 'self.outf.write' is the way to do it.
http://bazaar-vcs.org/WritingPlugins doesn't say anything about this.
Does anyone have any thoughts on these? I'd like to hear them before I
go and update the wiki page :)
jml
More information about the bazaar
mailing list