diff options
author | W. Trevor King <wking@drexel.edu> | 2009-11-21 12:23:47 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-11-21 12:23:47 -0500 |
commit | a07c70a8cb30fa7295471490a7b7fdfbd48a99ec (patch) | |
tree | a4a5a023d8c68b181a19a0bff561b37dd87ba4c1 /interfaces/xml | |
parent | 3b168403ff5e50d767476c4c0f037d1841bb2bf9 (diff) | |
download | bugseverywhere-a07c70a8cb30fa7295471490a7b7fdfbd48a99ec.tar.gz |
Upgraded `be show --xml` to new <be-xml> format.
Diffstat (limited to 'interfaces/xml')
-rwxr-xr-x | interfaces/xml/be-xml-to-mbox | 31 |
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) |