]> git.notmuchmail.org Git - notmuch/blobdiff - bindings/python/notmuch/message.py
python: Return a STATUS value in tags_to_flags and flags_to_tags
[notmuch] / bindings / python / notmuch / message.py
index 7bc7798c3cc7091ffd47ede9efe2f426bae17dd7..6ee5ec95e0bae524ba54f453f87335dad64da5eb 100644 (file)
@@ -19,7 +19,7 @@ Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>'
 """
 
 
-from ctypes import c_char_p, c_void_p, c_long, c_uint, c_int
+from ctypes import c_char_p, c_long, c_uint, c_int
 from datetime import date
 from notmuch.globals import (nmlib, STATUS, NotmuchError, Enum, _str,
     NotmuchTagsP, NotmuchMessagesP, NotmuchMessageP, NotmuchFilenamesP)
@@ -27,7 +27,6 @@ from notmuch.tag import Tags
 from notmuch.filename import Filenames
 import sys
 import email
-import types
 try:
     import simplejson as json
 except ImportError:
@@ -759,11 +758,11 @@ class Message(object):
         not work yet, as the modified tags have not been committed yet
         to the database.
 
-        :returns: a :class:`STATUS`. In short, you want to see
+        :returns: a :class:`STATUS` value. In short, you want to see
             notmuch.STATUS.SUCCESS here. See there for details."""
         if self._msg is None:
             raise NotmuchError(STATUS.NOT_INITIALIZED)
-        status = Message._tags_to_maildir_flags(self._msg)
+        return Message._tags_to_maildir_flags(self._msg)
 
     def maildir_flags_to_tags(self):
         """Synchronize file Maildir flags to notmuch tags
@@ -790,7 +789,7 @@ class Message(object):
             notmuch.STATUS.SUCCESS here. See there for details."""
         if self._msg is None:
             raise NotmuchError(STATUS.NOT_INITIALIZED)
-        status = Message._tags_to_maildir_flags(self._msg)
+        return Message._tags_to_maildir_flags(self._msg)
 
     def __repr__(self):
         """Represent a Message() object by str()"""