summaryrefslogtreecommitdiff
path: root/src
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
commitf47897be1ad5351bdb91388d07c0c876c4084b11 (patch)
treede811fc1f4e617345ccbe2a843500fc6d9b06f04 /src
parentdff590ed62efd8393f6603842ff9da239e6811f5 (diff)
Update docstrings
Diffstat (limited to 'src')
-rw-r--r--src/leap/mail/imap/fetch.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/leap/mail/imap/fetch.py b/src/leap/mail/imap/fetch.py
index 9cd2940..d78b4ee 100644
--- a/src/leap/mail/imap/fetch.py
+++ b/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