aboutsummaryrefslogtreecommitdiffstats
path: root/misc/xml
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2010-01-21 10:25:24 -0500
committerW. Trevor King <wking@drexel.edu>2010-01-21 10:25:24 -0500
commite5c65b664a56fe63fa8b6a40680200cd47219618 (patch)
treec411b3bff24e8f98bbfa7d36e52519e0df84aad1 /misc/xml
parenta7134ad51224e33df79d4589b677ad0718387f48 (diff)
downloadbugseverywhere-e5c65b664a56fe63fa8b6a40680200cd47219618.tar.gz
Add wrap_id to improve id handling in be-xml-to-mbox
Diffstat (limited to 'misc/xml')
-rwxr-xr-xmisc/xml/be-xml-to-mbox11
1 files changed, 9 insertions, 2 deletions
diff --git a/misc/xml/be-xml-to-mbox b/misc/xml/be-xml-to-mbox
index 015444e..81741bf 100755
--- a/misc/xml/be-xml-to-mbox
+++ b/misc/xml/be-xml-to-mbox
@@ -122,6 +122,11 @@ class Bug (LimitedAttrDict):
else:
self[field.tag] = text
+def wrap_id(id):
+ if "@" not in id:
+ return "<%s@%s>" % (id, DEFAULT_DOMAIN)
+ return id
+
class Comment (LimitedAttrDict):
_attrs = [u"uuid",
u"alt-id",
@@ -142,7 +147,9 @@ class Comment (LimitedAttrDict):
elif "alt-id" in self: id = self["alt-id"]
else: id = None
if id != None:
- print "Message-id: <%s@%s>" % (id, DEFAULT_DOMAIN)
+ print "Message-id: %s" % wrap_id(id)
+ if "alt-id" in self:
+ print "Alt-id: %s" % wrap_id(self["alt-id"])
print "Date: %s" % self["date"]
print "From: %s" % self["author"]
subject = ""
@@ -155,7 +162,7 @@ class Comment (LimitedAttrDict):
print "Subject: %s" % subject
if "in-reply-to" not in self.keys():
self["in-reply-to"] = bug["uuid"]
- print "In-Reply-To: <%s@%s>" % (self["in-reply-to"], DEFAULT_DOMAIN)
+ print "In-Reply-To: %s" % wrap_id(self["in-reply-to"])
if "extra-strings" in self:
for estr in self["extra_strings"]:
print "X-Extra-String: %s" % estr