diff options
author | Kali Kaneko <kali@leap.se> | 2014-01-24 05:39:13 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2014-01-28 19:38:45 -0400 |
commit | e02db78b1b6d8fe021efd4adb250c64a1dd4bac4 (patch) | |
tree | 8837eb90579898f2488dfe7fd581c87dd3a43def /src/leap/mail/utils.py | |
parent | ff28e22977db802c87f0b7be99e37c6de29183e9 (diff) |
flags use the memstore
* add new/dirty deferred dict to notify when written to disk
* fix eventual duplication after copy
* fix flag flickering on first retrieval.
Diffstat (limited to 'src/leap/mail/utils.py')
-rw-r--r-- | src/leap/mail/utils.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/leap/mail/utils.py b/src/leap/mail/utils.py index 64af04f..bae2898 100644 --- a/src/leap/mail/utils.py +++ b/src/leap/mail/utils.py @@ -36,6 +36,15 @@ def first(things): return None +def empty(thing): + """ + Return True if a thing is None or its length is zero. + """ + if thing is None: + return True + return len(thing) == 0 + + def maybe_call(thing): """ Return the same thing, or the result of its invocation if it is a |