summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2014-10-06 09:56:25 -0500
committerRuben Pollan <meskio@sindominio.net>2014-10-12 01:27:03 -0500
commit36692e5eaf64bbeb2f707b6e5c00d95137ea6810 (patch)
treec204a7ac6d4da3f557bdc5eeca5ff109d89ce310
parent075c4cb959f6dca059d64fc6fd7bc79765277d48 (diff)
Update docstrings
-rw-r--r--mail/src/leap/mail/imap/fetch.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/mail/src/leap/mail/imap/fetch.py b/mail/src/leap/mail/imap/fetch.py
index 9cd2940d..d78b4eed 100644
--- a/mail/src/leap/mail/imap/fetch.py
+++ b/mail/src/leap/mail/imap/fetch.py
@@ -31,7 +31,7 @@ from email.utils import parseaddr
from StringIO import StringIO
from twisted.python import log
-from twisted.internet import defer
+from twisted.internet import defer, reactor
from twisted.internet.task import LoopingCall
from twisted.internet.task import deferLater
from u1db import errors as u1db_errors
@@ -343,14 +343,12 @@ class LeapIncomingMail(object):
and data, the json-encoded, decrypted content of the
incoming message
:type msgtuple: (SoledadDocument, str)
- :return: a SoledadDocument and the processed data.
- :rtype: (doc, data)
+ :return: the processed data.
+ :rtype: str
"""
log.msg('processing decrypted doc')
doc, data = msgtuple
- from twisted.internet import reactor
-
# XXX turn this into an errBack for each one of
# the deferreds that would process an individual document
try:
@@ -382,7 +380,7 @@ class LeapIncomingMail(object):
# ok, this is an incoming message
rawmsg = msg.get(self.CONTENT_KEY, None)
if not rawmsg:
- return False
+ return ""
return self._maybe_decrypt_msg(rawmsg)
@deferred_to_thread
@@ -415,7 +413,7 @@ class LeapIncomingMail(object):
:param data: the text to be decrypted.
:type data: str
- :return: data, possibly descrypted.
+ :return: data, possibly decrypted.
:rtype: str
"""
leap_assert_type(data, str)
@@ -474,8 +472,9 @@ class LeapIncomingMail(object):
:param senderPubkey: The key of the sender of the message.
:type senderPubkey: OpenPGPKey
- :return: A unitary tuple containing a decrypted message.
- :rtype: (Message)
+ :return: A tuple containing a decrypted message and
+ a bool indicating whether the signature is valid.
+ :rtype: (Message, bool)
"""
log.msg('decrypting multipart encrypted msg')
msg = copy.deepcopy(msg)
@@ -594,7 +593,6 @@ class LeapIncomingMail(object):
incoming message
:type msgtuple: (SoledadDocument, str)
"""
- from twisted.internet import reactor
msgtuple = first(result)
doc, data = msgtuple