我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用kivy.properties.ListProperty()。
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