Support for content-type in comments
authorAaron Bentley <abentley@panoramicfeedback.com>
Thu, 6 Apr 2006 16:50:57 +0000 (12:50 -0400)
committerAaron Bentley <abentley@panoramicfeedback.com>
Thu, 6 Apr 2006 16:50:57 +0000 (12:50 -0400)
libbe/bugdir.py

index b680d16c22fad903bcaff59a3a6b5f9f6e0d7de3..414b47e2522885270f0ba4e93e2d32283392eb90 100644 (file)
@@ -348,16 +348,18 @@ class Comment(object):
             self.date = utility.str_to_time(mapfile["Date"])
             self.From = mapfile["From"]
             self.in_reply_to = mapfile.get("In-reply-to")
+            self.content_type = mapfile.get("Content-type", "text/plain")
             self.body = file(self.get_path("body")).read().decode("utf-8")
         else:
             self.date = None
             self.From = None
             self.in_reply_to = None
+            self.content_type = "text/plain"
             self.body = None
 
     def save(self):
         map_file = {"Date": utility.time_to_str(self.date)}
-        add_headers(self, map_file, ("From", "in_reply_to"))
+        add_headers(self, map_file, ("From", "in_reply_to", "content_type"))
         if not os.path.exists(self.get_path(None)):
             self.bug.rcs.mkdir(self.get_path(None))
         map_save(self.bug.rcs, self.get_path("values"), map_file)