diff options
author | W. Trevor King <wking@drexel.edu> | 2010-01-21 09:17:40 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2010-01-21 09:17:40 -0500 |
commit | a7134ad51224e33df79d4589b677ad0718387f48 (patch) | |
tree | 234673618f378d3e379885fac5e897319cb4d1e2 /misc/xml/be-mail-to-xml | |
parent | be2de86f947b7bf2bb44f415df0a6f685633a64b (diff) | |
download | bugseverywhere-a7134ad51224e33df79d4589b677ad0718387f48.tar.gz |
Converted `be list --xml` to <be-xml> format.
Fixed up be-xml-to-mbox following the recent libbe restructuring.
Moved stdout manipulation in be-mail-to-xml into the if __name__ ==
'__main__' block, in case some other module wants to recycle some of
its functions/methods.
Diffstat (limited to 'misc/xml/be-mail-to-xml')
-rwxr-xr-x | misc/xml/be-mail-to-xml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/xml/be-mail-to-xml b/misc/xml/be-mail-to-xml index 0b33465..5a1a88f 100755 --- a/misc/xml/be-mail-to-xml +++ b/misc/xml/be-mail-to-xml @@ -23,20 +23,17 @@ followed by a blank line. """ import base64 -import codecs import email.utils from libbe.util.encoding import get_output_encoding from libbe.util.utility import time_to_str import mailbox # the mailbox people really want an on-disk copy import optparse -import sys from time import asctime, gmtime, mktime import types from xml.sax.saxutils import escape BREAK = u'--' # signature separator DEFAULT_ENCODING = get_output_encoding() -sys.stdout = codecs.getwriter(DEFAULT_ENCODING)(sys.stdout) KNOWN_IDS = [] @@ -172,4 +169,7 @@ def main(argv): if __name__ == "__main__": import sys + import codecs + + sys.stdout = codecs.getwriter(DEFAULT_ENCODING)(sys.stdout) main(sys.argv) |