aboutsummaryrefslogtreecommitdiffstats
path: root/interfaces/xml
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-07-29 15:56:10 -0400
committerW. Trevor King <wking@drexel.edu>2009-07-29 15:56:10 -0400
commitdcfe9d5e292fa4a405fafb4bdd6d9e2070f30fa9 (patch)
treef9e9c8d2ba5190d1a71046cdb5fb3abdc0fcf74f /interfaces/xml
parent4e8882e74aad64859a16f17fa6bef8c04b33913d (diff)
parent22a38de80ee11ada710bc6766798ca608f938307 (diff)
downloadbugseverywhere-dcfe9d5e292fa4a405fafb4bdd6d9e2070f30fa9.tar.gz
Merged interactive email interface
Diffstat (limited to 'interfaces/xml')
-rwxr-xr-xinterfaces/xml/be-mbox-to-xml8
-rwxr-xr-xinterfaces/xml/be-xml-to-mbox6
2 files changed, 6 insertions, 8 deletions
diff --git a/interfaces/xml/be-mbox-to-xml b/interfaces/xml/be-mbox-to-xml
index 335f92f..dc6a1c5 100755
--- a/interfaces/xml/be-mbox-to-xml
+++ b/interfaces/xml/be-mbox-to-xml
@@ -28,8 +28,6 @@ from libbe.encoding import get_encoding, set_IO_stream_encodings
from mailbox import mbox, Message # the mailbox people really want an on-disk copy
from time import asctime, gmtime
import types
-from xml.sax import make_parser
-from xml.sax.handler import ContentHandler
from xml.sax.saxutils import escape
DEFAULT_ENCODING = get_encoding()
@@ -43,7 +41,7 @@ def comment_message_to_xml(message, fields=None):
new_fields = {}
new_fields[u'alt-id'] = message[u'message-id']
new_fields[u'in-reply-to'] = message[u'in-reply-to']
- new_fields[u'from'] = message[u'from']
+ new_fields[u'author'] = message[u'from']
new_fields[u'date'] = message[u'date']
new_fields[u'content-type'] = message.get_content_type()
for k,v in new_fields.items():
@@ -80,12 +78,12 @@ def comment_message_to_xml(message, fields=None):
if message.is_multipart():
ret = []
alt_id = fields[u'alt-id']
- from_str = fields[u'from']
+ from_str = fields[u'author']
date = fields[u'date']
for m in message.walk():
if m == message:
continue
- fields[u'from'] = from_str
+ fields[u'author'] = from_str
fields[u'date'] = date
if len(ret) > 0: # we've added one part already
fields.pop(u'alt-id') # don't pass alt-id to other parts
diff --git a/interfaces/xml/be-xml-to-mbox b/interfaces/xml/be-xml-to-mbox
index ea77c34..c630447 100755
--- a/interfaces/xml/be-xml-to-mbox
+++ b/interfaces/xml/be-xml-to-mbox
@@ -129,7 +129,7 @@ class Comment (LimitedAttrDict):
u"alt-id",
u"short-name",
u"in-reply-to",
- u"from",
+ u"author",
u"date",
u"content-type",
u"body"]
@@ -137,7 +137,7 @@ class Comment (LimitedAttrDict):
if bug == None:
bug = Bug()
bug[u"uuid"] = u"no-uuid"
- name,addr = email.utils.parseaddr(self["from"])
+ name,addr = email.utils.parseaddr(self["author"])
print "From %s %s" % (addr, rfc2822_to_asctime(self["date"]))
if "uuid" in self: id = self["uuid"]
elif "alt-id" in self: id = self["alt-id"]
@@ -145,7 +145,7 @@ class Comment (LimitedAttrDict):
if id != None:
print "Message-ID: <%s@%s>" % (id, DEFAULT_DOMAIN)
print "Date: %s" % self["date"]
- print "From: %s" % self["from"]
+ print "From: %s" % self["author"]
subject = ""
if "short-name" in self:
subject += self["short-name"]+u": "