GWLogger.py 文件源码

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

项目:SWProxy-plugins 作者: lstern 项目源码 文件源码
def group_battles(self, cache):
        list = sorted(cache.values(), key=get_match_id)
        grouped = groupby(list, lambda x: x['match_id'])
        groups = []
        for key, group in grouped:
            matches = []
            battle = {}
            first = True
            for item in group:
                if first:
                    first = False
                    battle['guild'] = item['op_guild']
                    battle['type'] = item['type']
                    battle['match_id'] = item['match_id']
                matches.append(item)
            battle['matches'] = matches
            groups.append(battle)
        return groups
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号