2005/03/28
CommitMessage and HTML emails
| /metameta/English.lproj/TextFilterInspector.nib/ info.nib, keyedobjects.nib |
=================================================================== --- mm/English.lproj/Test.nib/info.nib 2004-05-28 20:49:23 UTC (rev 81) +++ mm/English.lproj//Test.nib/info.nib 2004-05-28 20:49:37 UTC (rev 82) @@ -11,6 +11,6 @@14 IBSystem Version -7F44 +7H63
=================================================================== (Binary files differ)
- Get and install commitmessage.
- From the root of the commitmessage installation, create a new directory for the HTML extension
$ mkdir commitmessage/views/extensions/
- Download my html-extension.tar.gz and extract it in the commitmessage installation. It should create a commitmessage/views/extensions directory.
- In the commitmessage.conf, in the [views] section, you probably have a something like:
email = commitmessage.views.email.TigrisStyleEmailViewReplace it with:email = commitmessage.views.extensions.htmlmail.HTMLStyleEmailView
- You can test it right away in the root of the commitmessage installation with:
$ python main.py /path/to/your/svn/repository any-revision-number
Some problems with Python when writing this extension. I'm an absolute beginner in Python, so I'm probably missing something. My first implementation used mimetools and MimeWrite, but I learned that the email module was probably better, I rewrote it. The issue was that I included my HTMLStyleEmailView inside the commitmessage-provided email.py (thus commitmessage.views.email module), and doing an import email from within this module was ambiguous. I moved everything to a separate commitmessage.views.extensions module and everything was fine. Please let me know if there is a clean way to reference a top-level module from a module with a similar name.
I was not able to just inherit from BaseEmailView as the execute method finishes the mail headers before calling generateBody, and I needed header customization to define the MIME multipart info.