diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2016-12-14 14:11:17 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2016-12-21 17:09:25 -0800 |
commit | 5745e2291fb4d3c81076256d8bc563d50da16da5 (patch) | |
tree | 38db1ea9de4dc80abfbb676288646686863ac7c4 /alot | |
parent | 236bfb5cbde93df7ebf725ff433f37541a529227 (diff) |
Fix "superflous paren" warnings from pylint
In alot/helper.py this is a fairly obvious change. In alot/buffers.py
I've taken the liberty of replacing a somewhat odd use of multiplication
that relies on the bool class (True and False) implementing an __int__
method. These are used to add the 's' to the end of 'message' if there
are more than one message (thus messages), this is much clearer (and
more correct) when implemented as a ternary instead.
Diffstat (limited to 'alot')
-rw-r--r-- | alot/buffers.py | 4 | ||||
-rw-r--r-- | alot/helper.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/alot/buffers.py b/alot/buffers.py index e6f6d42c..b73b2ecd 100644 --- a/alot/buffers.py +++ b/alot/buffers.py @@ -225,13 +225,13 @@ class SearchBuffer(Buffer): def __str__(self): formatstring = '[search] for "%s" (%d message%s)' return formatstring % (self.querystring, self.result_count, - 's' * (not (self.result_count == 1))) + 's' if self.result_count > 1 else '') def get_info(self): info = {} info['querystring'] = self.querystring info['result_count'] = self.result_count - info['result_count_positive'] = 's' * (not (self.result_count == 1)) + info['result_count_positive'] = 's' if self.result_count > 1 else '' return info def cleanup(self): diff --git a/alot/helper.py b/alot/helper.py index a79f72cb..253fa899 100644 --- a/alot/helper.py +++ b/alot/helper.py @@ -442,7 +442,7 @@ def libmagic_version_at_least(version): # if it's not present, we can't guess right, so let's assume False return False - return (magic_wrapper.magic_version >= version) + return magic_wrapper.magic_version >= version # TODO: make this work on blobs, not paths |