aboutsummaryrefslogtreecommitdiffhomepage
path: root/bindings
diff options
context:
space:
mode:
authorGravatar Justus Winter <4winter@informatik.uni-hamburg.de>2012-12-21 10:41:29 +0100
committerGravatar Justus Winter <4winter@informatik.uni-hamburg.de>2012-12-21 10:56:06 +0100
commit0687e2ae2350c04e465bf50abfd9db155c5eae14 (patch)
treeb3a6e745e5d11d35e5ebd8272a57470edb2916a4 /bindings
parent8728340644da8af1d60af6c9ee329a83549b9ce7 (diff)
python: remove functions that have been marked as deprecated in 0.14
Removes Message.{format,print}_messages. 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. The code has been marked as deprecated in 0.14 and is now removed. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/notmuch/messages.py81
1 files changed, 0 insertions, 81 deletions
diff --git a/bindings/python/notmuch/messages.py b/bindings/python/notmuch/messages.py
index e83455b9..97167bd1 100644
--- a/bindings/python/notmuch/messages.py
+++ b/bindings/python/notmuch/messages.py
@@ -191,87 +191,6 @@ class Messages(object):
if self._msgs:
self._destroy(self._msgs)
- def format_messages(self, format, indent=0, entire_thread=False):
- """Formats messages as needed for 'notmuch show'.
-
- :param format: A string of either 'text' or 'json'.
- :param indent: A number indicating the reply depth of these messages.
- :param entire_thread: A bool, indicating whether we want to output
- whole threads or only the matching messages.
- :return: a list of lines
-
- .. deprecated:: 0.14
- 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.15.
- """
- result = list()
-
- if format.lower() == "text":
- set_start = ""
- set_end = ""
- set_sep = ""
- elif format.lower() == "json":
- set_start = "["
- set_end = "]"
- set_sep = ", "
- else:
- raise TypeError("format must be either 'text' or 'json'")
-
- first_set = True
-
- result.append(set_start)
-
- # iterate through all toplevel messages in this thread
- for msg in self:
- # if not msg:
- # break
- if not first_set:
- result.append(set_sep)
- first_set = False
-
- result.append(set_start)
- match = msg.is_match()
- next_indent = indent
-
- if (match or entire_thread):
- if format.lower() == "text":
- result.append(msg.format_message_as_text(indent))
- else:
- result.append(msg.format_message_as_json(indent))
- next_indent = indent + 1
-
- # get replies and print them also out (if there are any)
- replies = msg.get_replies().format_messages(format, next_indent, entire_thread)
- if replies:
- result.append(set_sep)
- result.extend(replies)
-
- result.append(set_end)
- result.append(set_end)
-
- return result
-
- def print_messages(self, format, indent=0, entire_thread=False, handle=sys.stdout):
- """Outputs messages as needed for 'notmuch show' to a file like object.
-
- :param format: A string of either 'text' or 'json'.
- :param handle: A file like object to print to (default is sys.stdout).
- :param indent: A number indicating the reply depth of these messages.
- :param entire_thread: A bool, indicating whether we want to output
- whole threads or only the matching messages.
-
- .. deprecated:: 0.14
- 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.15.
- """
- handle.write(''.join(self.format_messages(format, indent, entire_thread)))
-
class EmptyMessagesResult(Messages):
def __init__(self, parent):
self._msgs = None