aboutsummaryrefslogtreecommitdiffstats
path: root/xml/be-mbox-to-xml
Commit message (Collapse)AuthorAgeFilesLines
* be-mbox-to-xml passes attributes on to each part of multipart messages.W. Trevor King2009-07-121-10/+20
| | | | | | | | | | | | | | | | | | | | | | Previously "message[<some-attr>]" just returned None if it wasn't set for that message part, which overwrote anything passed in through fields. "from" and "date" added to list of attributes passed along. For be-xml-to-mbox, "alt-id" was added to Comment._attrs, and Comment.print_to_mbox was adjusted to handle the case where we have no information about the parent bug. With all of this, I can complete the loop be-mbox-to-xml example.mbox | be-xml-to-mbox > example2.mbox without errors :p. Finally, be-xml-to-mbox has been adjusted to also work on files (it had previously only handled data via stdin). We can't add stdin handling to be-mbox-to-xml though, because the mailbox package needs an actual file to work on, and I haven't setup a tmpfile workaround yet...
* Added be-mbox-to-xml.W. Trevor King2009-07-121-0/+94
Reworked to allow "be comment" to handle unicode strings (see bug e4ed63f6-9000-4d0b-98c3-487269140141). The solution was to escape all the unicode to produce and ASCII string before calling ElementTree.XML, and then converting back to unicode afterwards. Added a unicode-containing comment to the end of bug f7ccd916-b5c7-4890-a2e3-8c8ace17ae3a so that there's a handy unicode comment for testing. XML headers (e.g. '<?xml version="1.0" encoding="UTF-8" ?>') are now added to all xml output from be. Switched non-text/* encoding library to base64 instead of email.encoders, which makes that code in libbe/comment.py simpler. Changed libbe/mapfile.py error encoding from string_escape to unicode_escape so it can handle unicode. Everything's still untested, and be-xml-to-mbox doesn't handle unicode yet, but I felt this commit was getting a bit unwieldy ;).