Skip to content

Commit

Permalink
Revert "formatter: hide block on 'None' string too"
Browse files Browse the repository at this point in the history
This reverts commit fa201df.
  • Loading branch information
Toby Dacre authored and tobes committed Sep 22, 2018
1 parent 5fdb2b3 commit a702489
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions py3status/formatter.py
Expand Up @@ -315,11 +315,11 @@ def get(self, get_params, block):
value = value_ = output.format(**{self.key: value})

if block.commands.not_zero:
valid = value_ not in ['', 'None', None, False, '0', '0.0', 0, 0.0]
valid = value_ not in ['', None, False, '0', '0.0', 0, 0.0]
else:
# '', None, and False are ignored
# numbers like 0 and 0.0 are not.
valid = not (value_ in ['', 'None', None] or value_ is False)
valid = not (value_ in ['', None] or value_ is False)
enough = False
except: # noqa e722
# Exception raised when we don't have the param
Expand Down
5 changes: 0 additions & 5 deletions tests/test_formatter.py
Expand Up @@ -27,7 +27,6 @@
'no': False,
'empty': '',
'None': None,
'None_str': 'None',
'?bad name': 'evil',
u'☂ Very bad name ': u'☂ extremely evil',
'long_str': 'I am a long string though not too long',
Expand Down Expand Up @@ -331,10 +330,6 @@ def test_27():
run_formatter({'format': '{None}', 'expected': '', })


def test_27a():
run_formatter({'format': '[Hi, my name is {None_str}]', 'expected': '', })


def test_28():
run_formatter({'format': '[{None}] hello', 'expected': ' hello', })

Expand Down

0 comments on commit a702489

Please sign in to comment.