Updating the service search to python-brisa 0.10 version.
authorHenry Bilby <henrymiller.engenheiro@gmail.com>
Mon, 8 Jun 2009 14:50:46 +0000 (10:50 -0400)
committerHenry Bilby <henrymiller.engenheiro@gmail.com>
Mon, 8 Jun 2009 14:50:46 +0000 (10:50 -0400)
zukebox_server/src/services/search/zukebox_search.py
zukebox_server/src/xml_descriptions/zukebox-search-scpd.xml

index c1f0c22..438f86a 100644 (file)
@@ -13,6 +13,11 @@ plugin_section = 'zukebox_server_plugin-audio-library'
 db_path = manager.get_parameter(plugin_section, 'database_location')
 webserver = None
 
+class SearchOutBoundExcept(Exception):
+    def __init__(self, *args, **kargs):
+        Exception.__init__(self, *args, **kargs)
+
+
 class Search(Service):
        """Class Search
            Implements a search service of zukebox-server
@@ -20,23 +25,13 @@ class Search(Service):
 
        service_type = "urn:schemas-upnp-org:service:Search:1"
        service_name = "Search"
+       facade = ZFacade(db_path, webserver)
 
        def __init__(self, xml_path):
            scpd_path = pjoin(xml_path, "zukebox-search-scpd.xml");
-           Service.__init__(self, service_name, service_type, '', scpd_path,
-               SearchController(service_type))
-
-       def get_list_audio(self):
-           return self.control_controller.get_list_audio()
-
-class SearchController(ServiceController):
-       """Class Search:
-           Implements a search service of zukebox-server
-       """
-       facade = ZFacade(db_path, webserver)
+           Service.__init__(self, service_name, service_type, '', scpd_path)
+           log.info("Search service scpd_path = %s" % scpd_path)
 
-       def __init__(self, service_type):
-           ServiceController.__init__(self, service_type)
            self.genre_list = []
            self.name_music_list = []
            self.name_artist_list = []
index 7c97433..0ffb405 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<scpd xmls="urn:schemas-upnp-org:service-1-0">
+<scpd xmlns="urn:schemas-upnp-org:service-1-0">
        <specVersion>
                <major>1</major>
                <minor>0</minor>
@@ -7,23 +7,19 @@
        <serviceStateTable>
                <stateVariable sendEvents="yes">
                        <name>genre_list</name>
-                       <dataType>list</dataType>
-                       <defaultValue> </defaultValue>
+                       <dataType>ui4</dataType>
                </stateVariable>
                <stateVariable sendEvents="yes">
                        <name>name_music_list</name>
-                       <dataType>list</dataType>
-                       <defaultValue> </defaultValue>
+                       <dataType>ui4</dataType>
                </stateVariable>
                <stateVariable sendEvents="yes">
                        <name>name_artist_list</name>
-                       <dataType>list</dataType>
-                       <defaultValue> </defaultValue>
+                       <dataType>ui4</dataType>
                </stateVariable>
                <stateVariable sendEvents="yes">
                        <name>all_audio_list</name>
-                       <dataType>list</dataType>
-                       <defaultValue> </defaultValue>
+                       <dataType>ui4</dataType>
                </stateVariable>
        </serviceStateTable>
        <actionList>