Browse Source

remove unnecessary method stubs (NotImplementedError vs AttributeError, eugh)

Natenom/support-murmur-13-1446181288462
Michael Ziegler 14 years ago
parent
commit
775db4497f
  1. 6
      pyweb/mumble/MumbleCtlIce.py
  2. 80
      pyweb/mumble/mctl.py

6
pyweb/mumble/MumbleCtlIce.py

@ -15,6 +15,7 @@
* GNU General Public License for more details.
"""
from functools import wraps
from StringIO import StringIO
from os.path import exists, join
from os import unlink, name as os_name
@ -38,12 +39,13 @@ def protectDjangoErrPage( func ):
non-existant files and borking.
"""
@wraps(func)
def protection_wrapper( *args, **kwargs ):
""" Call the original function and catch Ice exceptions. """
try:
return func( *args, **kwargs );
except Ice.Exception, e:
raise e;
except Ice.Exception, err:
raise err;
protection_wrapper.innerfunc = func
return protection_wrapper;

80
pyweb/mumble/mctl.py

@ -17,86 +17,11 @@
import re
class MumbleCtlBase (object):
class MumbleCtlBase(object):
""" This class defines the base interface that the Mumble model expects. """
cache = {};
def getAllConf(self, srvid):
raise NotImplementedError( "mctl::getAllConf" );
def getVersion( self ):
raise NotImplementedError( "mctl::getVersion" );
def getConf(self, srvid, key):
raise NotImplementedError( "mctl::getConf" );
def setConf(self, srvid, key, value):
raise NotImplementedError( "mctl::setConf" );
def getDefaultConf(self):
raise NotImplementedError( "mctl::getDefaultConf" );
def newServer(self):
raise NotImplementedError( "mctl::newServer" );
def setSuperUserPassword(self, srvid, value):
raise NotImplementedError( "mctl::setSuperUserPassword" );
def start(self, srvid):
raise NotImplementedError( "mctl::start" );
def stop(self, srvid):
raise NotImplementedError( "mctl::stop" );
def isBooted(self, srvid):
raise NotImplementedError( "mctl::isBooted" );
def deleteServer(self, srvid):
raise NotImplementedError( "mctl::deleteServer" );
def getPlayers(self, srvid):
raise NotImplementedError( "mctl::getPlayers" );
def getRegisteredPlayers(self, srvid, filter):
raise NotImplementedError( "mctl::getRegisteredPlayers" );
def getChannels(self, srvid):
raise NotImplementedError( "mctl::getChannels" );
def registerPlayer(self, srvid, name, email, password):
raise NotImplementedError( "mctl::registerPlayer" );
def getRegistration(self, srvid, mumbleid):
raise NotImplementedError( "mctl::getRegistration" );
def setRegistration(self, srvid, mumbleid, name, email, password):
raise NotImplementedError( "mctl::setRegistration" );
def unregisterPlayer(self, srvid, mumbleid):
raise NotImplementedError( "mctl::unregisterPlayer" );
def getBootedServers(self):
raise NotImplementedError( "mctl::getBootedServers" );
def getAllServers(self):
raise NotImplementedError( "mctl::getAllServers" );
def getACL(self, srvid, channelid):
raise NotImplementedError( "mctl::getACL" );
def setACL(self, srvid, channelid, acl, groups, inherit):
raise NotImplementedError( "mctl::setACL" );
def getTexture(self, srvid, mumbleid):
raise NotImplementedError( "mctl::getTexture" );
def setTexture(self, srvid, mumbleid, infile):
raise NotImplementedError( "mctl::setTexture" );
def verifyPassword( self, srvid, username, password ):
raise NotImplementedError( "mctl::verifyPassword" );
@staticmethod
def newInstance( connstring, slicefile=None, icesecret=None ):
""" Create a new CTL object for the given connstring.
@ -131,6 +56,3 @@ class MumbleCtlBase (object):
@staticmethod
def clearCache():
MumbleCtlBase.cache = {};
Loading…
Cancel
Save