]> git.cworth.org Git - notmuch/blobdiff - cnotmuch/message.py
Debian pkg creation stuff
[notmuch] / cnotmuch / message.py
index ba93d8fea773fdb1807f9dddc1417973b48caf69..0e5057f42751310094626e8bd63171f9ff64dce7 100644 (file)
@@ -16,7 +16,7 @@
 #    (C) Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
 #                       Jesse Rosenthal <jrosenthal@jhu.edu>
         
 #    (C) Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
 #                       Jesse Rosenthal <jrosenthal@jhu.edu>
         
-from ctypes import c_char_p, c_void_p, c_long, c_bool
+from ctypes import c_char_p, c_void_p, c_long, c_uint
 from datetime import date
 from cnotmuch.globals import nmlib, STATUS, NotmuchError, Enum
 from cnotmuch.tag import Tags
 from datetime import date
 from cnotmuch.globals import nmlib, STATUS, NotmuchError, Enum
 from cnotmuch.tag import Tags
@@ -243,7 +243,7 @@ class Message(object):
 
     """notmuch_message_get_flag"""
     _get_flag = nmlib.notmuch_message_get_flag
 
     """notmuch_message_get_flag"""
     _get_flag = nmlib.notmuch_message_get_flag
-    _get_flag.restype = c_bool
+    _get_flag.restype = c_uint
 
     """notmuch_message_get_message_id (notmuch_message_t *message)"""
     _get_message_id = nmlib.notmuch_message_get_message_id
 
     """notmuch_message_get_message_id (notmuch_message_t *message)"""
     _get_message_id = nmlib.notmuch_message_get_message_id
@@ -406,7 +406,7 @@ class Message(object):
 
         :param flag: One of the :attr:`Message.FLAG` values (currently only 
                      *Message.FLAG.MATCH*
 
         :param flag: One of the :attr:`Message.FLAG` values (currently only 
                      *Message.FLAG.MATCH*
-        :returns: A bool, indicating whether the flag is set.
+        :returns: An unsigned int (0/1), indicating whether the flag is set.
         :exception: :exc:`NotmuchError` STATUS.NOT_INITIALIZED if the message 
               is not initialized.
         """
         :exception: :exc:`NotmuchError` STATUS.NOT_INITIALIZED if the message 
               is not initialized.
         """
@@ -705,7 +705,7 @@ class Message(object):
                 elif (cont_type.lower() == "text/html" and 
                       i == 0):
                     part_dict["content"] = msg.get_payload()
                 elif (cont_type.lower() == "text/html" and 
                       i == 0):
                     part_dict["content"] = msg.get_payload()
-        body.append(part_dict)
+            body.append(part_dict)
 
         output["body"] = body
 
 
         output["body"] = body
 
@@ -727,19 +727,19 @@ class Message(object):
         output += "\n\fheader{"
 
         #Todo: this date is supposed to be prettified, as in the index.
         output += "\n\fheader{"
 
         #Todo: this date is supposed to be prettified, as in the index.
-        output += "\n%s (%s) (" % (format["headers"]["from"],
-                                   format["headers"]["date"])
+        output += "\n%s (%s) (" % (format["headers"]["From"],
+                                   format["headers"]["Date"])
         output += ", ".join(format["tags"])
         output += ")"
 
         output += ", ".join(format["tags"])
         output += ")"
 
-        output += "\nSubject: %s" % format["headers"]["subject"]
-        output += "\nFrom: %s" % format["headers"]["from"]
-        output += "\nTo: %s" % format["headers"]["to"]
-        if format["headers"]["cc"]:
-            output += "\nCc: %s" % format["headers"]["cc"]
-        if format["headers"]["bcc"]:
-            output += "\nBcc: %s" % format["headers"]["bcc"]
-        output += "\nDate: %s" % format["headers"]["date"]
+        output += "\nSubject: %s" % format["headers"]["Subject"]
+        output += "\nFrom: %s" % format["headers"]["From"]
+        output += "\nTo: %s" % format["headers"]["To"]
+        if format["headers"]["Cc"]:
+            output += "\nCc: %s" % format["headers"]["Cc"]
+        if format["headers"]["Bcc"]:
+            output += "\nBcc: %s" % format["headers"]["Bcc"]
+        output += "\nDate: %s" % format["headers"]["Date"]
         output += "\n\fheader}"
 
         output += "\n\fbody{"
         output += "\n\fheader}"
 
         output += "\n\fbody{"
@@ -750,16 +750,16 @@ class Message(object):
             if not p.has_key("filename"):
                 output += "\n\fpart{ "
                 output += "ID: %d, Content-type: %s\n" % (p["id"], 
             if not p.has_key("filename"):
                 output += "\n\fpart{ "
                 output += "ID: %d, Content-type: %s\n" % (p["id"], 
-                                                         p["content_type"])
+                                                         p["content-type"])
                 if p.has_key("content"):
                     output += "\n%s\n" % p["content"]
                 else:
                 if p.has_key("content"):
                     output += "\n%s\n" % p["content"]
                 else:
-                    output += "Non-text part: %s\n" % p["content_type"]
+                    output += "Non-text part: %s\n" % p["content-type"]
                     output += "\n\fpart}"                    
             else:
                 output += "\n\fattachment{ "
                 output += "ID: %d, Content-type:%s\n" % (p["id"], 
                     output += "\n\fpart}"                    
             else:
                 output += "\n\fattachment{ "
                 output += "ID: %d, Content-type:%s\n" % (p["id"], 
-                                                         p["content_type"])
+                                                         p["content-type"])
                 output += "Attachment: %s\n" % p["filename"]
                 output += "\n\fattachment}\n"
 
                 output += "Attachment: %s\n" % p["filename"]
                 output += "\n\fattachment}\n"