diff options
author | Kali Kaneko <kali@leap.se> | 2014-01-28 18:39:59 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2014-01-30 14:20:44 -0400 |
commit | a7e0054b595822325f749b0b1df7d25cab4e6486 (patch) | |
tree | ca1434b4bc03ccca4dcdd9519b3973da179d4809 /src/leap/mail/utils.py | |
parent | f096368cfbc49caab52811ae50388aae74272a1a (diff) |
docstring fixes
Also some fixes for None comparisons.
Diffstat (limited to 'src/leap/mail/utils.py')
-rw-r--r-- | src/leap/mail/utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/leap/mail/utils.py b/src/leap/mail/utils.py index 1f43947..6a1fcde 100644 --- a/src/leap/mail/utils.py +++ b/src/leap/mail/utils.py @@ -21,6 +21,8 @@ import json import re import traceback +from leap.soledad.common.document import SoledadDocument + CHARSET_PATTERN = r"""charset=([\w-]+)""" CHARSET_RE = re.compile(CHARSET_PATTERN, re.IGNORECASE) @@ -42,6 +44,8 @@ def empty(thing): """ if thing is None: return True + if isinstance(thing, SoledadDocument): + thing = thing.content try: return len(thing) == 0 except ReferenceError: |