Deleting the playlist path
authorAndre L. V. Loureiro <loureiro.andrew@gmail.com>
Thu, 21 May 2009 20:53:23 +0000 (16:53 -0400)
committerHenry Bilby <henrymiller.engenheiro@gmail.com>
Sat, 23 May 2009 01:19:50 +0000 (21:19 -0400)
zukebox_server/src/playlist/seeker.py [deleted file]
zukebox_server/src/playlist/zukebox_playlist.py [deleted file]

diff --git a/zukebox_server/src/playlist/seeker.py b/zukebox_server/src/playlist/seeker.py
deleted file mode 100644 (file)
index 56d3403..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-
-class Seeker(object):
-    """This class implements a pointer for ZukeBox playlist
-    A seeker response to a request about the current position, next
-    or previous.
-    """
-    def __init__(self, playlist):
-        if playlist is not None:
-            self.playlist = playlist
-            # the first time the previous position is the current
-            self.current = playlist.current
-            self.previous = self.current
-            self.next = None
-
-    def get_next_pos(self):
-        next = self.current + 1
-        self.next = next
-
-    def get_previous_pos(self):
-        prev = self.previous
-        if prev != 0:
-            prev = prev - 1
-            self.previous = prev
-
-    def get_next(self):
-        self.get_next_pos()
-        return self.playlist.pop(self.next)
-
-    def get_prev(self):
-        self.get_previous_pos()
-        return self.playlist.pop(self.previous)
-
diff --git a/zukebox_server/src/playlist/zukebox_playlist.py b/zukebox_server/src/playlist/zukebox_playlist.py
deleted file mode 100644 (file)
index 7e29d8a..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-
-import os
-
-from brisa.core import log
-from brisa.upnp.device import Service, ServiceController
-
-pjoin = os.path.join
-
-class PlayListOutBoundExcept(Exception):
-    def __rep__(self):
-        return "Play List Out of Bounds!"
-
-
-
-class PlayList(Service):
-    """Class PlayList
-    Introduction
-    ============
-    Implements a playlist for ZukeBox server.
-    """
-
-    service_type = "urn:schemas-upnp-org:service:PlayList:1"
-    service_name = "PlayList"
-
-    def __init__(self, positions=10, xml_path):
-        scpd_path = pjoin(xml_path, "zukebox-playlist-scpd.xml")
-        Service.__init__(self, service_name, service_type, '', scpd_path,
-                PlayListControl(positions, service_type))
-
-    def get_playlist(self):
-        return self.control_controller.get_playlist()
-
-class PlayListControl(ServiceController):
-
-    def __init__(self, positions, serv_type):
-        ServiceController.__init__(self, serv_type)
-        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:
-            locked = False
-        rt = {"Locked": locked}
-        return {"IsLockedResponse": rt}
-
-    def soap_IsAvailble(self, *args, **kwargs):
-        availble = False
-        if not len(self.list) == 0:
-            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():
-            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)
-
-            return {"Append": {}}
-        else:
-            raise PlayListOutBoundExcept()
-
-    def soap_Drop(self, *args, **kwargs):
-        """Pop the object at position passed by index
-        """
-        if self.is_availble():
-            index = kwargs["Index"]
-            self.list.pop(index)
-            return {"Drop": {}}
-        else:
-            raise PlayListOutBoundExcept()
-
-    def soap_GetSizeOfPlayList(self, *args, **kwargs):
-        """Return the size of playlist"""
-        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():
-            self.list = []
-
-    def get_playlist(self):
-        return self.list