aboutsummaryrefslogtreecommitdiffstats
path: root/interfaces
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-11-21 12:23:47 -0500
committerW. Trevor King <wking@drexel.edu>2009-11-21 12:23:47 -0500
commita07c70a8cb30fa7295471490a7b7fdfbd48a99ec (patch)
treea4a5a023d8c68b181a19a0bff561b37dd87ba4c1 /interfaces
parent3b168403ff5e50d767476c4c0f037d1841bb2bf9 (diff)
downloadbugseverywhere-a07c70a8cb30fa7295471490a7b7fdfbd48a99ec.tar.gz
Upgraded `be show --xml` to new <be-xml> format.
Diffstat (limited to 'interfaces')
-rwxr-xr-xinterfaces/xml/be-xml-to-mbox31
1 files changed, 17 insertions, 14 deletions
diff --git a/interfaces/xml/be-xml-to-mbox b/interfaces/xml/be-xml-to-mbox
index ecc6327..dc4524e 100755
--- a/interfaces/xml/be-xml-to-mbox
+++ b/interfaces/xml/be-xml-to-mbox
@@ -86,20 +86,23 @@ class Bug (LimitedAttrDict):
u"comments",
u"extra-strings"]
def print_to_mbox(self):
- name,addr = email.utils.parseaddr(self["creator"])
- print "From %s %s" % (addr, rfc2822_to_asctime(self["created"]))
- print "Message-id: <%s@%s>" % (self["uuid"], DEFAULT_DOMAIN)
- print "Date: %s" % self["created"]
- print "From: %s" % self["creator"]
- print "Content-Type: %s; charset=%s" % ("text/plain", DEFAULT_ENCODING)
- print "Content-Transfer-Encoding: 8bit"
- print "Subject: %s: %s" % (self["short-name"], self["summary"])
- if "extra-strings" in self:
- for estr in self["extra_strings"]:
- print "X-Extra-String: %s" % estr
- print ""
- print self["summary"]
- print ""
+ if "creator" in self:
+ # otherwise, probably a `be show` uuid-only bug to avoid
+ # root comments.
+ name,addr = email.utils.parseaddr(self["creator"])
+ print "From %s %s" % (addr, rfc2822_to_asctime(self["created"]))
+ print "Message-id: <%s@%s>" % (self["uuid"], DEFAULT_DOMAIN)
+ print "Date: %s" % self["created"]
+ print "From: %s" % self["creator"]
+ print "Content-Type: %s; charset=%s" % ("text/plain", DEFAULT_ENCODING)
+ print "Content-Transfer-Encoding: 8bit"
+ print "Subject: %s: %s" % (self["short-name"], self["summary"])
+ if "extra-strings" in self:
+ for estr in self["extra_strings"]:
+ print "X-Extra-String: %s" % estr
+ print ""
+ print self["summary"]
+ print ""
if "comments" in self:
for comment in self["comments"]:
comment.print_to_mbox(self)