From: Andre L. V. Loureiro Date: Wed, 20 May 2009 06:26:37 +0000 (-0400) Subject: Fixed the signature in PlayListControl X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=5d1115fdb8618eb02d435d18327246b348643d6c;p=zukebox Fixed the signature in PlayListControl --- diff --git a/zukebox_server/src/playlist/zukebox_playlist.py b/zukebox_server/src/playlist/zukebox_playlist.py index 1828b50..0f3887e 100644 --- a/zukebox_server/src/playlist/zukebox_playlist.py +++ b/zukebox_server/src/playlist/zukebox_playlist.py @@ -34,38 +34,61 @@ class PlayListControl(ServiceController): self.positions = positions self.list = [] self.current = 0 + self.prev = self.current + self.next = None + self.from_name = None + self.to_name = None + self.current_uri = None + self.current_uri_metadata = None def soap_IsLocked(self, *args, **kwargs): + locked = True if not len(self.list) == self.positions: - return False - return True + locked = False + rt = {"Locked": locked} + return {"IsLockedResponse": rt} def soap_IsAvailble(self, *args, **kwargs): + availble = False if not len(self.list) == 0: - return True - return False + availble = True + rt = {"Availble": availble} + return {"IsAvailbleResponse": rt} def soap_Append(self, *args, **kwargs): """Put a object in the playlist """ if not self.is_locked(): - log.info("object in playlist") + self.current_uri = kwargs["CurrentURI"] + self.current_uri_metadata = kwargs["CurrentURIMetaData"] + self.from_name = kwargs["FromName"] + self.to_name = kwargs["ToName"] + self.list.append(self.current_uri) - self.list.append(obj) + return {"Append": {}} else: raise PlayListOutBoundExcept() - def drop(self, index): + def soap_Drop(self, *args, **kwargs): """Pop the object at position passed by index - @param index - @type integer """ if self.is_availble(): - self.zplaylist.pop(index) + index = kwargs["Index"] + self.list.pop(index) + return {"Drop": {}} + else: + raise PlayListOutBoundExcept() - def get_size(self): + def soap_GetSizeOfPlayList(self, *args, **kwargs): """Return the size of playlist""" - return len(self.zplaylist) + lenght = len(self.list) + rt = {"PlayListSize": lenght} + return {"GetSizeOfPlayListResponse": rt} + + def soap_GetCurrent(self, *args, **kwargs): + if self.is_availble(): + rt = {"CurrentPosition": self.list[self.current]} + return {"GetCurrentResponse": rt} def clean_playlist(self): if self.is_availble():