diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2018-04-24 09:20:22 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2018-04-24 09:20:22 -0700 |
commit | ecb5d076b52089638c85330655cdb9755fd876e6 (patch) | |
tree | 5a4ec3d6a4f23b4049da2c0877af138e986c690c /alot/db/manager.py | |
parent | bd7a5051e4aefb8ad1a8eea7f7b477d4038fd7de (diff) | |
parent | 1708fd59ed2a44bd543d510a4895aa95e30c9af3 (diff) |
Merge remote-tracking branch 'bignose/wip/issue/python3-codeclimate' into py3k
One small conflict caused by "db/utils: correctly handle 8bit encoded
mail"
Diffstat (limited to 'alot/db/manager.py')
-rw-r--r-- | alot/db/manager.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/alot/db/manager.py b/alot/db/manager.py index cbde9c88..057c72d0 100644 --- a/alot/db/manager.py +++ b/alot/db/manager.py @@ -160,15 +160,14 @@ class DBManager(object): for msg in query.search_messages(): msg.freeze() if cmd == 'tag': - for tag in tags: - msg.add_tag(tag, sync_maildir_flags=sync) + strategy = msg.add_tag if cmd == 'set': msg.remove_all_tags() - for tag in tags: - msg.add_tag(tag, sync_maildir_flags=sync) + strategy = msg.add_tag elif cmd == 'untag': - for tag in tags: - msg.remove_tag(tag, sync_maildir_flags=sync) + strategy = msg.remove_tag + for tag in tags: + strategy(tag, sync_maildir_flags=sync) msg.thaw() logging.debug('ended atomic') |