From a9b51e5a39f3375947204215c50ac70c86a176c7 Mon Sep 17 00:00:00 2001 From: schneefux Date: Wed, 1 Oct 2014 14:40:32 +0200 Subject: Use instance attributes in MPDWrapper --- client/modules/MPDControl.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'client/modules/MPDControl.py') diff --git a/client/modules/MPDControl.py b/client/modules/MPDControl.py index ecf857e..778fe5c 100644 --- a/client/modules/MPDControl.py +++ b/client/modules/MPDControl.py @@ -230,15 +230,6 @@ class Song(object): self.album = album class MPDWrapper(object): - - client = None - songs = [] # may have duplicates - playlists = [] - - # capitalized strings - song_titles = [] - song_artists = [] - def __init__(self, server="localhost", port=6600): """ Prepare the client and music variables @@ -260,6 +251,11 @@ class MPDWrapper(object): for playlist in self.playlists: self.client.load(playlist) + self.songs = [] # may have duplicates + # capitalized strings + self.song_titles = [] + self.song_artists = [] + soup = self.client.playlist() for i in range(0, len(soup) / 10): index = i * 10 -- cgit v1.3.1