python: pep8 compliance for message.py

This commit is contained in:
pazz 2011-07-12 20:46:59 +01:00 committed by Sebastian Spaeth
parent 9562c7d1fb
commit 61f0184707

View file

@ -31,7 +31,8 @@ try:
import simplejson as json
except ImportError:
import json
#------------------------------------------------------------------------------
class Messages(object):
"""Represents a list of notmuch messages
@ -222,7 +223,7 @@ class Messages(object):
sys.stdout.write(set_end)
sys.stdout.write(set_end)
#------------------------------------------------------------------------------
class Message(object):
"""Represents a single Email message
@ -296,7 +297,6 @@ class Message(object):
#keep reference to parent, so we keep it alive
self._parent = parent
def get_message_id(self):
"""Returns the message ID
@ -324,10 +324,11 @@ class Message(object):
if self._msg is None:
raise NotmuchError(STATUS.NOT_INITIALIZED)
return Message._get_thread_id (self._msg);
return Message._get_thread_id(self._msg)
def get_replies(self):
"""Gets all direct replies to this message as :class:`Messages` iterator
"""Gets all direct replies to this message as :class:`Messages`
iterator
.. note:: This call only makes sense if 'message' was
ultimately obtained from a :class:`Thread` object, (such as
@ -346,7 +347,7 @@ class Message(object):
if self._msg is None:
raise NotmuchError(STATUS.NOT_INITIALIZED)
msgs_p = Message._get_replies(self._msg);
msgs_p = Message._get_replies(self._msg)
if msgs_p is None:
return None
@ -557,8 +558,6 @@ class Message(object):
self.tags_to_maildir_flags()
return STATUS.SUCCESS
def remove_all_tags(self, sync_maildir_flags=False):
"""Removes all tags from the given message.
@ -684,7 +683,6 @@ class Message(object):
raise NotmuchError(status)
def is_match(self):
"""(Not implemented)"""
return self.get_flag(Message.FLAG.MATCH)
@ -753,7 +751,6 @@ class Message(object):
msg['date'] = date.fromtimestamp(self.get_date())
return "%(from)s (%(date)s) (%(tags)s)" % (msg)
def get_message_parts(self):
"""Output like notmuch show"""
fp = open(self.get_filename())
@ -858,11 +855,11 @@ class Message(object):
parts = format["body"]
parts.sort(key=lambda x: x['id'])
for p in parts:
if not p.has_key("filename"):
if not "filename" in p:
output += "\n\fpart{ "
output += "ID: %d, Content-type: %s\n" % (p["id"],
p["content-type"])
if p.has_key("content"):
if "content" in p:
output += "\n%s\n" % p["content"]
else:
output += "Non-text part: %s\n" % p["content-type"]