From 3f1ea998731ea3ec92b81624e4e6eec35c912b28 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Fri, 8 Oct 2010 20:41:17 +0200 Subject: [PATCH] add setTextureFromGravatar method and fix setTexture --- pyweb/mumble/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyweb/mumble/models.py b/pyweb/mumble/models.py index 6f91ea5..5e373d4 100644 --- a/pyweb/mumble/models.py +++ b/pyweb/mumble/models.py @@ -754,13 +754,16 @@ class MumbleUser( models.Model ): def setTexture( self, image ): """ Install the given image as the user's texture. """ - self.server.setTexture( self.mumbleid, image ) + self.server.setUserTexture( self.mumbleid, image ) def setTextureFromUrl( self, url, transparency=None ): """ Retrieve the image at the given URL and set it as my texture. """ img = Image.open( StringIO( urlopen( url ).read() ) ) self.setTexture( img ) + def setTextureFromGravatar( self ): + return self.setTextureFromUrl( self.gravatar ) + texture = property( getTexture, setTexture, doc="Get the texture as a PIL Image or set the Image as the texture." )