def build_filter_string(self, filter_input_value):
"""
TODO: document this function
:param filter_input_value:
:return:
"""
try:
parsed_filter = parse_filter(filter_input_value)
except pyparsing.ParseException:
raise ACFilterParsingException('Could not parse filter: "{0}"'.format(filter_input_value))
out_filter_list = list()
self.process_filter_element(parsed_filter[0], out_filter_list)
if out_filter_list[0] == '(':
# If out filter list starts with an opening parenthesis, remove first and last positions ad both will
# correspond to redundant parentheses
out_filter_list = out_filter_list[1: -1]
filter_string = ''.join(out_filter_list)
return filter_string
评论列表
文章目录