Forked mumble-django project from https://bitbucket.org/Svedrin/mumble-django
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
3.1 KiB

  1. # -*- coding: utf-8 -*-
  2. """
  3. * Copyright (C) 2009, withgod <withgod@sourceforge.net>
  4. * Michael "Svedrin" Ziegler <diese-addy@funzt-halt.net>
  5. *
  6. * Mumble-Django is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This package is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. """
  16. import re
  17. class MumbleCtlBase ():
  18. ''' abstract Ctrol Object '''
  19. def getAllConf(self, srvid):
  20. raise NotImplementedError( "mctl::getAllConf" );
  21. def getVersion( self ):
  22. raise NotImplementedError( "mctl::getVersion" );
  23. def setConf(self, srvid, key, value):
  24. raise NotImplementedError( "mctl::setConf" );
  25. def getDefaultConf(self):
  26. raise NotImplementedError( "mctl::getDefaultConf" );
  27. def newServer(self):
  28. raise NotImplementedError( "mctl::newServer" );
  29. def setSuperUserPassword(self, srvid, value):
  30. raise NotImplementedError( "mctl::setSuperUserPassword" );
  31. def start(self, srvid):
  32. raise NotImplementedError( "mctl::start" );
  33. def stop(self, srvid):
  34. raise NotImplementedError( "mctl::stop" );
  35. def isBooted(self, srvid):
  36. raise NotImplementedError( "mctl::isBooted" );
  37. def deleteServer(self, srvid):
  38. raise NotImplementedError( "mctl::deleteServer" );
  39. def getPlayers(self, srvid):
  40. raise NotImplementedError( "mctl::getPlayers" );
  41. def getRegisteredPlayers(self, srvid, filter):
  42. raise NotImplementedError( "mctl::getRegisteredPlayers" );
  43. def getChannels(self, srvid):
  44. raise NotImplementedError( "mctl::getChannels" );
  45. def registerPlayer(self, srvid, name):
  46. raise NotImplementedError( "mctl::registerPlayer" );
  47. def setRegistration(self, srvid, mumbleid, name, email, password):
  48. raise NotImplementedError( "mctl::setRegistration" );
  49. def unregisterPlayer(self, srvid, mumbleid):
  50. raise NotImplementedError( "mctl::unregisterPlayer" );
  51. def getBootedServers(self):
  52. raise NotImplementedError( "mctl::getBootedServers" );
  53. def getAllServers(self):
  54. raise NotImplementedError( "mctl::getAllServers" );
  55. def getACL(self, srvid, channelid):
  56. raise NotImplementedError( "mctl::getACL" );
  57. def setACL(self, srvid, acl):
  58. raise NotImplementedError( "mctl::setACL" );
  59. def getTexture(self, srvid, mumbleid):
  60. raise NotImplementedError( "mctl::getTexture" );
  61. def setTexture(self, srvid, mumbleid, infile):
  62. raise NotImplementedError( "mctl::setTexture" );
  63. @staticmethod
  64. def newInstance( connstring ):
  65. # connstring defines whether to connect via ICE or DBus.
  66. # Dbus service names: some.words.divided.by.periods
  67. # ICE specs are WAY more complex, so if DBus doesn't match, use ICE.
  68. rd = re.compile( r'^(\w+\.)*\w+$' );
  69. if rd.match( connstring ):
  70. from MumbleCtlDbus import MumbleCtlDbus
  71. return MumbleCtlDbus( connstring )
  72. else:
  73. from MumbleCtlIce import MumbleCtlIce
  74. return MumbleCtlIce( connstring )