summaryrefslogtreecommitdiff
path: root/client/src/leap/soledad
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-05-04 05:21:55 -0300
committerVictor Shyba <victor1984@riseup.net>2017-05-04 05:26:27 -0300
commit486909fdf644376dda282482565cc8fd70cff3e1 (patch)
tree833d6a1ca7b887e3e92dddb34add94fe62d9ccf7 /client/src/leap/soledad
parent681f87f85820ed807b8df26271d47dab18da05bb (diff)
[refactor] improve readability on _document
Diffstat (limited to 'client/src/leap/soledad')
-rw-r--r--client/src/leap/soledad/client/_document.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/client/src/leap/soledad/client/_document.py b/client/src/leap/soledad/client/_document.py
index 9ba08e93..89e75fa2 100644
--- a/client/src/leap/soledad/client/_document.py
+++ b/client/src/leap/soledad/client/_document.py
@@ -15,7 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
-Everything related to documents.
+Public interfaces for adding extra client features to the generic
+SoledadDocument.
"""
import enum
@@ -89,7 +90,7 @@ class IDocumentWithAttachment(Interface):
:rtype: Deferred
"""
- def attachment_state(self):
+ def get_attachment_state(self):
"""
Return the state of the attachment of this document.
@@ -103,7 +104,7 @@ class IDocumentWithAttachment(Interface):
def is_dirty(self):
"""
- Return wether this document's content differs from the contents stored
+ Return whether this document's content differs from the contents stored
in local database.
:return: Whether this document is dirty or not.
@@ -212,7 +213,7 @@ class Document(SoledadDocument):
raise NotImplementedError
@defer.inlineCallbacks
- def attachment_state(self):
+ def get_attachment_state(self):
state = AttachmentStates.NONE
if not self._blob_id:
@@ -243,11 +244,11 @@ class Document(SoledadDocument):
fd = yield self._manager.get_blob(self._blob_id)
# TODO: turn following method into a public one
yield self._manager._encrypt_and_upload(self._blob_id, fd)
- defer.returnValue(self.attachment_state())
+ defer.returnValue(self.get_attachment_state())
@defer.inlineCallbacks
def download_attachment(self):
if not self._blob_id:
defer.returnValue(None)
yield self.get_attachment()
- defer.returnValue(self.attachment_state())
+ defer.returnValue(self.get_attachment_state())