:TODO: Make the iterator work more than once and cache the tags in
the Python object.(?)
"""
- if msgs_p is None:
+ if not msgs_p:
raise NotmuchError(STATUS.NULL_POINTER)
self._msgs = msgs_p
automatically delete the parent object once all derived
objects are dead.
"""
- if msg_p is None:
+ if not msg_p:
raise NotmuchError(STATUS.NULL_POINTER)
self._msg = msg_p
#keep reference to parent, so we keep it alive
"""
if self._msg is None:
raise NotmuchError(STATUS.NOT_INITIALIZED)
- return Message._get_message_id(self._msg).decode('utf-8', errors='ignore')
+ return Message._get_message_id(self._msg).decode('utf-8', 'ignore')
def get_thread_id(self):
"""Returns the thread ID
if self._msg is None:
raise NotmuchError(STATUS.NOT_INITIALIZED)
- return Message._get_thread_id(self._msg).decode('utf-8', errors='ignore')
+ return Message._get_thread_id(self._msg).decode('utf-8', 'ignore')
def get_replies(self):
"""Gets all direct replies to this message as :class:`Messages`
msgs_p = Message._get_replies(self._msg)
- if msgs_p is None:
+ if not msgs_p:
return EmptyMessagesResult(self)
return Messages(msgs_p, self)
header = Message._get_header(self._msg, _str(header))
if header == None:
raise NotmuchError(STATUS.NULL_POINTER)
- return header.decode('UTF-8', errors='ignore')
+ return header.decode('UTF-8', 'ignore')
def get_filename(self):
"""Returns the file path of the message file
"""
if self._msg is None:
raise NotmuchError(STATUS.NOT_INITIALIZED)
- return Message._get_filename(self._msg).decode('utf-8', errors='ignore')
+ return Message._get_filename(self._msg).decode('utf-8', 'ignore')
def get_filenames(self):
"""Get all filenames for the email corresponding to 'message'