Python kivy.properties 模块,ListProperty() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用kivy.properties.ListProperty()

项目:mmplayer    作者:Bakterija    | 项目源码 | 文件源码
def refresh_media_id(self, *args):
        '''Updates id numbers for all files in self.media ListProperty'''
        mp = {}
        for i, x in enumerate(self.media):
            x['id'] = i
            mpath = x['path']
            if mpath in mp:
                mp[x['path']].append(i)
            else:
                mp[x['path']] = [i]
            x['playlist_name'] = self.name
            if not 'state' in x:
                x['state'] = 'normal'
        self.media_paths = mp