search.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:ac-mediator 作者: AudioCommons 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号