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.

115 lines
2.6 KiB

  1. # -*- coding: utf-8 -*-
  2. # mumble-django contributed by withgod@sourceforge.net
  3. #zope.interface is good but don't standard interface library
  4. #abc is better but 2.6 higher.
  5. #import abc
  6. from django.conf import settings
  7. class MumbleCtlBase ():
  8. ''' abstract Ctrol Object '''
  9. def getAllConf(self, srvid):
  10. pass
  11. def setConf(self, srvid, key, value):
  12. pass
  13. def getDefaultConf(self):
  14. pass
  15. def getValue(self, srvid, key):
  16. pass
  17. def newServer(self):
  18. pass
  19. def setSuperUserPassword(self, srvid, value):
  20. pass
  21. def start(self, srvid):
  22. pass
  23. def stop(self, srvid):
  24. pass
  25. def isBooted(self, srvid):
  26. pass
  27. def deleteServer(self, srvid):
  28. pass
  29. def getUsers(self, srvid):
  30. pass
  31. def getPlayers(self, srvid):
  32. pass
  33. def getRegisteredPlayers(self, srvid):
  34. pass
  35. def getChannels(self, srvid):
  36. pass
  37. def registerPlayer(self, srvid, name):
  38. pass
  39. def setRegistration(self, srvid, mumbleid, name, email, password):
  40. pass
  41. def unregisterPlayer(self, srvid, mumbleid):
  42. pass
  43. def getBootedServers(self):
  44. pass
  45. def getAllServers(self):
  46. pass
  47. def getACL(self, srvid, identifier):
  48. pass
  49. def setACL(self, srvid, acl):
  50. pass
  51. def getTexture(self, srvid, mumbleid):
  52. pass
  53. def setTexture(self, srvid, mumbleid, infile):
  54. pass
  55. @staticmethod
  56. def newInstance():
  57. # if dbus
  58. if settings.DAOTYPE == 'dbus':
  59. from MumbleCtlDbus import MumbleCtlDbus
  60. return MumbleCtlDbus()
  61. else:
  62. from MumbleCtlIce import MumbleCtlIce
  63. return MumbleCtlIce()
  64. if __name__ == "__main__":
  65. import sys
  66. from MumbleCtlIce import MumbleCtlIce
  67. from MumbleCtlDbus import MumbleCtlDbus
  68. x = int(sys.argv[1])
  69. dbusCtl = MumbleCtlDbus()
  70. iceCtl = MumbleCtlIce()
  71. print "equal test ---"
  72. print "getBootedServers [%s]" % (dbusCtl.getBootedServers() == iceCtl.getBootedServers())
  73. print "getChannels [%s]" % (dbusCtl.getChannels(x) == iceCtl.getChannels(x))
  74. print "getPlayers [%s]" % (dbusCtl.getPlayers(x) == iceCtl.getPlayers(x))
  75. print "getACL(x, 0) [%s]" % (dbusCtl.getACL(x, 0) == iceCtl.getACL(x, 0))
  76. print "getAllServers [%s]" % (dbusCtl.getAllServers() == iceCtl.getAllServers())
  77. print "getDefaultConf [%s]" % (dbusCtl.getDefaultConf() == iceCtl.getDefaultConf())
  78. print "getAllConf(x) [%s]" % (dbusCtl.getAllConf(x) == iceCtl.getAllConf(x))
  79. print dbusCtl.getRegisteredPlayers(x)
  80. #print dbusCtl.getRegisteredPlayers(x)[3][1]
  81. print iceCtl.getRegisteredPlayers(x)
  82. #print iceCtl.getRegisteredPlayers(x)[3][1]
  83. print "getRegisteredPlayers(x) [%s]" % (dbusCtl.getRegisteredPlayers(x) == iceCtl.getRegisteredPlayers(x))
  84. #print "getTexture(2, 30) [%s]" % (dbusCtl.getTexture(2, 30) == iceCtl.getTexture(2, 30))
  85. #print dbusCtl.getTexture(2, 30).__class__