Closed tilmanginzel closed 4 years ago
Hey @tilmanginzel, the filtering you're describing above is not reflected in the PR, all three fields are just checked whether they're not None
, not whether they've got any contents, i.e. a non-empty string. Did you commit all your changes?
@trietsch I might be missing something, but is this not a valid check if a string is empty (or None) in python?
➜ ~ python2.7
>>> s = ""
>>> if s:
... print "a"
... else:
... print "b"
...
b
>>> s = None
>>> if s:
... print "a"
... else:
... print "b"
...
b
>>>
Ah, yeah, true indeed. I was mislead by the fact that you said that the third one had a different check. Feel free to merge (with or without the proposal of the check).
Ok great, will merge then and publish a new version! :)
@trietsch Please review :)
This is probably not the most pythonic way for the condition, but it should do the job. Devices are now filtered if:
name
oraddress
are empty or nullconnected
is None (condition slightly differs from the other two as we don't want to filterfalse
values ;))What do you think?