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. 33
      pyweb/mumble/models.py

4
pyweb/mumble/mmobjects.py

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

33
pyweb/mumble/models.py

@ -143,17 +143,17 @@ class Mumble( models.Model ):
doc=_('Superuser Password') doc=_('Superuser Password')
) )
url = mk_config_property( "registerurl", ugettext_noop("Website URL") )
motd = mk_config_property( "welcometext", ugettext_noop("Welcome Message") )
passwd = mk_config_property( "password", ugettext_noop("Server Password") )
users = mk_config_property( "users", ugettext_noop("Max. Users"), get_coerce=int )
bwidth = mk_config_property( "bandwidth", ugettext_noop("Bandwidth [Bps]"), get_coerce=int )
sslcrt = mk_config_property( "certificate", ugettext_noop("SSL Certificate") )
sslkey = mk_config_property( "key", ugettext_noop("SSL Key") )
player = mk_config_property( "username", ugettext_noop("Player name regex") )
channel = mk_config_property( "channelname", ugettext_noop("Channel name regex") )
defchan = mk_config_property( "defaultchannel", ugettext_noop("Default channel"), get_coerce=int )
timeout = mk_config_property( "timeout", ugettext_noop("Timeout"), get_coerce=int )
url = mk_config_property( "registerurl", ugettext_noop("Website URL") )
motd = mk_config_property( "welcometext", ugettext_noop("Welcome Message") )
passwd = mk_config_property( "password", ugettext_noop("Server Password") )
users = mk_config_property( "users", ugettext_noop("Max. Users"), get_coerce=int )
bwidth = mk_config_property( "bandwidth", ugettext_noop("Bandwidth [Bps]"), get_coerce=int )
sslcrt = mk_config_property( "certificate", ugettext_noop("SSL Certificate") )
sslkey = mk_config_property( "key", ugettext_noop("SSL Key") )
player = mk_config_property( "username", ugettext_noop("Player name regex") )
channel = mk_config_property( "channelname", ugettext_noop("Channel name regex") )
defchan = mk_config_property( "defaultchannel", ugettext_noop("Default channel"), get_coerce=int )
timeout = mk_config_property( "timeout", ugettext_noop("Timeout"), get_coerce=int )
obfsc = mk_config_bool_property( "obfuscate", ugettext_noop("IP Obfuscation") ) obfsc = mk_config_bool_property( "obfuscate", ugettext_noop("IP Obfuscation") )
certreq = mk_config_bool_property( "certrequired", ugettext_noop("Require Certificate") ) certreq = mk_config_bool_property( "certrequired", ugettext_noop("Require Certificate") )
@ -195,11 +195,8 @@ class Mumble( models.Model ):
but to Murmur as well. but to Murmur as well.
""" """
if dontConfigureMurmur: if dontConfigureMurmur:
# skip murmur configuration, e.g. because we're inserting models for existing servers.
return models.Model.save( self ); 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: if self.id is None:
self.srvid = self.ctl.newServer(); self.srvid = self.ctl.newServer();
@ -220,7 +217,6 @@ class Mumble( models.Model ):
else: else:
self.ctl.setConf( self.srvid, 'registerhostname', '' ); self.ctl.setConf( self.srvid, 'registerhostname', '' );
# Now allow django to save the record set
return models.Model.save( self ); return models.Model.save( self );
@ -454,7 +450,7 @@ class Mumble( models.Model ):
else: else:
return urlunsplit(( "mumble", self.netloc, "", versionstr, "" )) 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." ); 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 ): def save( self, dontConfigureMurmur=False ):
""" Save the settings in this model to Murmur. """ """ Save the settings in this model to Murmur. """
if dontConfigureMurmur: if dontConfigureMurmur:
# skip murmur configuration, e.g. because we're inserting models for existing players.
return models.Model.save( self ); return models.Model.save( self );
# Before the record set is saved, update Murmur via controller.
ctl = self.server.ctl; ctl = self.server.ctl;
if self.owner: if self.owner:
@ -566,7 +560,6 @@ class MumbleUser( models.Model ):
# Don't save the users' passwords, we don't need them anyway # Don't save the users' passwords, we don't need them anyway
self.password = ''; self.password = '';
# Now allow django to save the record set
return models.Model.save( self ); return models.Model.save( self );
def __init__( self, *args, **kwargs ): def __init__( self, *args, **kwargs ):
@ -602,7 +595,7 @@ class MumbleUser( models.Model ):
self._registration = self.server.ctl.getRegistration( self.server.srvid, self.mumbleid ); self._registration = self.server.ctl.getRegistration( self.server.srvid, self.mumbleid );
return self._registration; return self._registration;
registration = property( getRegistration, doc=getRegistration.__doc__ );
registration = property( getRegistration );
# Texture handlers # Texture handlers
def getTexture( self ): def getTexture( self ):

Loading…
Cancel
Save