controller_trackview.py 文件源码

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

项目:ATLeS 作者: liffiton 项目源码 文件源码
def _filter_row(row, filters):
    def filterfunc(row, filt):
        val = filters[filt]['val']
        if filt == "tracks":
            tracks_set = set(val.split('|'))
            return row['trackrel'] in tracks_set
        elif filt.endswith(" (min)"):
            filt = filt.replace(" (min)", "")
            val = float(val)
            return row[filt] >= val
        elif filt.endswith(" (max)"):
            filt = filt.replace(" (max)", "")
            val = float(val)
            return row[filt] <= val
        elif isinstance(row[filt], bool):
            # need to convert our string query values to bool for the comparison
            return row[filt] == bool(val)
        else:
            return row[filt] == val

    return all(filterfunc(row, filt) for filt in filters)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号