From 84ccb94516223be11eb81e850aa412fa16a9b231 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Wed, 12 May 2010 12:36:03 +0200 Subject: [PATCH] use spaces instead of commas to separate lists and include proper xmlns definitions --- pyweb/mumble/mmobjects.py | 4 ++-- pyweb/mumble/models.py | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pyweb/mumble/mmobjects.py b/pyweb/mumble/mmobjects.py index d6e8ff5..387e2a0 100644 --- a/pyweb/mumble/mmobjects.py +++ b/pyweb/mumble/mmobjects.py @@ -167,7 +167,7 @@ class mmChannel( object ): if isinstance( val, bool ): me.set( key, unicode(val).lower() ) elif isinstance( val, list ) or isinstance( val, tuple ): - me.set( key, ','.join( ( unicode(elem) for elem in val ) ) ) + me.set( key, ' '.join( ( unicode(elem) for elem in val ) ) ) elif isinstance( val, str ): me.set( key, unicode(val, "utf8") ) else: @@ -305,7 +305,7 @@ class mmPlayer( object ): if isinstance( val, bool ): me.set( key, unicode(val).lower() ) elif isinstance( val, list ) or isinstance( val, tuple ): - me.set( key, ','.join( ( unicode(elem) for elem in val ) ) ) + me.set( key, ' '.join( ( unicode(elem) for elem in val ) ) ) elif isinstance( val, str ): me.set( key, unicode(val, "utf8") ) else: diff --git a/pyweb/mumble/models.py b/pyweb/mumble/models.py index a419ae2..94f67a1 100644 --- a/pyweb/mumble/models.py +++ b/pyweb/mumble/models.py @@ -557,8 +557,16 @@ class Mumble( models.Model ): def asXml( self, authed=False ): from xml.etree.cElementTree import Element - root = Element( "server", id=unicode(self.id), name=self.name ) + root = Element( "server", + xmlns="http://mumble.sourceforge.net/Channel_Viewer_Protocol", + id=unicode(self.id), name=self.name + ) root.set( 'x-connecturl', self.connecturl ) + root.set( 'xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance" ) + root.set( 'xsi:schemaLocation', + "http://bitbucket.org/Svedrin/mumble-django/wiki/channel-viewer-protocol_murmur-%d-%d-%d.xsd" % self.version[:3] + ) + self.rootchan.asXml( root, authed ) return root