bug 907146, update filter.py for metro, f=flod
I also reworked the python code to be easier to read, and
use string return values instead of bools.