Browse Source

various style fixes

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
17e0aa285e
  1. 4
      pyweb/mumble/mmobjects.py
  2. 11
      pyweb/mumble/models.py

4
pyweb/mumble/mmobjects.py

@ -66,7 +66,7 @@ class mmChannel( object ):
return self._acl;
acl = property( getACL, doc=getACL.__doc__ );
acl = property( getACL );
is_server = False;
@ -130,7 +130,7 @@ class mmChannel( object ):
else:
return urlunsplit(( "mumble", self.server.netloc, urlpath, versionstr, "" ))
connecturl = property( getURL, doc="A convenience wrapper for getURL." );
connecturl = property( getURL );
def setDefault( self ):
""" Make this the server's default channel. """

11
pyweb/mumble/models.py

@ -195,11 +195,8 @@ class Mumble( models.Model ):
but to Murmur as well.
"""
if dontConfigureMurmur:
# skip murmur configuration, e.g. because we're inserting models for existing servers.
return models.Model.save( self );
# check if this server already exists, if not call newServer and set my srvid first
if self.id is None:
self.srvid = self.ctl.newServer();
@ -220,7 +217,6 @@ class Mumble( models.Model ):
else:
self.ctl.setConf( self.srvid, 'registerhostname', '' );
# Now allow django to save the record set
return models.Model.save( self );
@ -454,7 +450,7 @@ class Mumble( models.Model ):
else:
return urlunsplit(( "mumble", self.netloc, "", versionstr, "" ))
connecturl = property( getURL, doc=getURL.__doc__ );
connecturl = property( getURL );
version = property( lambda self: self.ctl.getVersion(), doc="The version of Murmur." );
@ -533,10 +529,8 @@ class MumbleUser( models.Model ):
def save( self, dontConfigureMurmur=False ):
""" Save the settings in this model to Murmur. """
if dontConfigureMurmur:
# skip murmur configuration, e.g. because we're inserting models for existing players.
return models.Model.save( self );
# Before the record set is saved, update Murmur via controller.
ctl = self.server.ctl;
if self.owner:
@ -566,7 +560,6 @@ class MumbleUser( models.Model ):
# Don't save the users' passwords, we don't need them anyway
self.password = '';
# Now allow django to save the record set
return models.Model.save( self );
def __init__( self, *args, **kwargs ):
@ -602,7 +595,7 @@ class MumbleUser( models.Model ):
self._registration = self.server.ctl.getRegistration( self.server.srvid, self.mumbleid );
return self._registration;
registration = property( getRegistration, doc=getRegistration.__doc__ );
registration = property( getRegistration );
# Texture handlers
def getTexture( self ):

Loading…
Cancel
Save