where '%s' is replaced with first element of bits. call the method parser.compile_filter with second element of bits as an argument, substitute the result for filepath.
filepath = parser . compile_filter ( bits [ 1 ] )