<short-name>com-1</short-name>
<from></from>
<date>Thu, 01 Jan 1970 00:00:00 +0000</date>
+ <content-type>text/plain</content-type>
<body>Some
insightful
remarks</body>
("in-reply-to", self.in_reply_to),
("from", self._setting_attr_string("From")),
("date", self.time_string),
+ ("content-type", self.content_type),
("body", (self.body or "").rstrip('\n'))]
lines = ["<comment>"]
for (k,v) in info:
import email.utils
import types
+from libbe.encoding import get_encoding, set_IO_stream_encodings
from libbe.utility import str_to_time as rfc2822_to_gmtime_integer
from time import asctime, gmtime
from xml.sax import make_parser
DEFAULT_DOMAIN = "invalid.com"
DEFAULT_EMAIL = "dummy@" + DEFAULT_DOMAIN
+DEFAULT_ENCODING = get_encoding()
+set_IO_stream_encodings(DEFAULT_ENCODING)
def rfc2822_to_asctime(rfc2822_string):
"""Convert an RFC 2822-fomatted string into a asctime string.
print "Message-ID: <%s@%s>" % (self["uuid"], DEFAULT_DOMAIN)
print "Date: %s" % self["created"]
print "From: %s" % self["creator"]
- print "Content-Type: %s" % "text/plain; charset=utf-8"
+ print "Content-Type: %s; charset=%s" % ("text/plain", DEFAULT_ENCODING)
print "Content-Transfer-Encoding: 8bit"
print "Subject: %s: %s" % (self["short-name"], self["summary"])
print ""
u"in-reply-to",
u"from",
u"date",
+ u"content-type",
u"body"]
def print_to_mbox(self, bug):
name,addr = email.utils.parseaddr(self["from"])
print "Message-ID: <%s@%s>" % (self["uuid"], DEFAULT_DOMAIN)
print "Date: %s" % self["date"]
print "From: %s" % self["from"]
- print "Content-Type: %s" % "text/plain; charset=utf-8"
+ print "Content-Type: %s; charset=%s" % (self["content-type"], DEFAULT_ENCODING)
print "Content-Transfer-Encoding: 8bit"
print "Subject: %s: %s" % (self["short-name"], bug["summary"])
if "in-reply-to" not in self.keys():