[Chandler-dev] Getting started with a python script for Chandler

Jeffrey Harris jeffrey at osafoundation.org
Fri Nov 30 11:12:17 PST 2007


Hi Andre,

> I'm sure I'm violating a few standard practices and such, but that 
> was fun, and it works.  :)

Heh, I'd completely forgotten about the print >> file, foo idiom,
usually I see file.write(foo), but either is fine.  You might consider:

import codecs
file = codecs.open(filename, "a", "utf-8")

so you don't have to convert your unicode string-by-string.

> A minor thing I'm not able to solve right now is how to get the menu
> item title to read something other than "Some action" from your
> original template. I've replaced that string in my version, but the
> menu item title hasn't changed.

You're bumping into the difference between persisted items (which are
created once, then left alone) and code that's re-interpreted on every
run.  The code in installParcel is only run when you install the plugin.

Wiping your repository and restarting ought to bring in the new menu
name, but I think it would also work to just bump the version number in
your setup.py and re-run RunPython setup.py develop.

Sincerely,
Jeffrey


More information about the chandler-dev mailing list