X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=bindings%2Fpython%2Fnotmuch%2Fmessage.py;h=0e65694e0c63e978754e5e6137a0475a33d3d3b8;hb=0a357fe4105b3ea936b41584cb40312e84a1e67a;hp=20ba9cb918cbca07d05a4266d63a02898895334d;hpb=69f077898a65c10453d08dd94bf4c94efc69b91b;p=notmuch
diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py
index 20ba9cb9..0e65694e 100644
--- a/bindings/python/notmuch/message.py
+++ b/bindings/python/notmuch/message.py
@@ -14,7 +14,7 @@ for more details.
You should have received a copy of the GNU General Public License
along with notmuch. If not, see .
-Copyright 2010 Sebastian Spaeth '
+Copyright 2010 Sebastian Spaeth
Jesse Rosenthal
"""
@@ -26,17 +26,19 @@ from .globals import (
Enum,
_str,
Python3StringMixIn,
- STATUS,
- NotmuchError,
- NullPointerError,
- NotInitializedError,
NotmuchTagsP,
NotmuchMessageP,
NotmuchMessagesP,
NotmuchFilenamesP,
)
+from .errors import (
+ STATUS,
+ NotmuchError,
+ NullPointerError,
+ NotInitializedError,
+)
from .tag import Tags
-from .filename import Filenames
+from .filenames import Filenames
import email
try:
@@ -257,7 +259,7 @@ class Message(Python3StringMixIn):
files_p = Message._get_filenames(self._msg)
- return Filenames(files_p, self).as_generator()
+ return Filenames(files_p, self)
def get_flag(self, flag):
"""Checks whether a specific flag is set for this message
@@ -612,7 +614,15 @@ class Message(Python3StringMixIn):
"""Create an internal representation of the message parts,
which can easily be output to json, text, or another output
format. The argument match tells whether this matched a
- query."""
+ query.
+
+ .. deprecated:: 0.13
+ This code adds functionality at the python
+ level that is unlikely to be useful for
+ anyone. Furthermore the python bindings strive
+ to be a thin wrapper around libnotmuch, so
+ this code will be removed in notmuch 0.14.
+ """
output = {}
output["id"] = self.get_message_id()
output["match"] = self.is_match()
@@ -658,12 +668,29 @@ class Message(Python3StringMixIn):
def format_message_as_json(self, indent=0):
"""Outputs the message as json. This is essentially the same
as python's dict format, but we run it through, just so we
- don't have to worry about the details."""
+ don't have to worry about the details.
+
+ .. deprecated:: 0.13
+ This code adds functionality at the python
+ level that is unlikely to be useful for
+ anyone. Furthermore the python bindings strive
+ to be a thin wrapper around libnotmuch, so
+ this code will be removed in notmuch 0.14.
+ """
return json.dumps(self.format_message_internal())
def format_message_as_text(self, indent=0):
"""Outputs it in the old-fashioned notmuch text form. Will be
- easy to change to a new format when the format changes."""
+ easy to change to a new format when the format changes.
+
+ .. deprecated:: 0.13
+ This code adds functionality at the python
+ level that is unlikely to be useful for
+ anyone. Furthermore the python bindings strive
+ to be a thin wrapper around libnotmuch, so
+ this code will be removed in notmuch 0.14.
+ """
+
format = self.format_message_internal()
output = "\fmessage{ id:%s depth:%d match:%d filename:%s" \
@@ -739,5 +766,5 @@ class Message(Python3StringMixIn):
def __del__(self):
"""Close and free the notmuch Message"""
- if self._msg is not None:
+ if self._msg:
self._destroy(self._msg)