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.

143 lines
3.2 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. @staticmethod
  52. def newInstance():
  53. # if dbus
  54. if settings.DAOTYPE == 'dbus':
  55. from MumbleCtlDbus import MumbleCtlDbus
  56. return MumbleCtlDbus()
  57. else:
  58. from MumbleCtlIce import MumbleCtlIce
  59. return MumbleCtlIce()
  60. if __name__ == "__main__":
  61. import sys
  62. from MumbleCtlIce import MumbleCtlIce
  63. from MumbleCtlDbus import MumbleCtlDbus
  64. x = int(sys.argv[1])
  65. dbusCtl = MumbleCtlDbus()
  66. iceCtl = MumbleCtlIce()
  67. '''
  68. print "--- Dbus test start"
  69. #ctl = MumbleCtlBase.newInstance()
  70. print dbusCtl
  71. print dbusCtl.meta
  72. print "booted server", dbusCtl.getBootedServers()
  73. print "chans"
  74. print dbusCtl.getChannels(x)
  75. print "users"
  76. print dbusCtl.getPlayers(x)
  77. print "getACL", dbusCtl.getACL(x, 0)
  78. print "getAllServers()"
  79. print dbusCtl.getAllServers()
  80. print "getDefaultConf()"
  81. print dbusCtl.getDefaultConf()
  82. print "getAllConf(x)"
  83. print dbusCtl.getAllConf(x)
  84. print "--Dbus end--"
  85. print "--- Ice test start"
  86. print iceCtl
  87. print iceCtl.meta
  88. print "booted server", iceCtl.getBootedServers()
  89. print "chans"
  90. print iceCtl.getChannels(x)
  91. print "users"
  92. print iceCtl.getPlayers(x)
  93. print "getACL", iceCtl.getACL(x, 0)
  94. print "getAllServers()"
  95. print iceCtl.getAllServers()
  96. print "getDefaultConf()"
  97. print iceCtl.getDefaultConf()
  98. print "getAllConf(x)"
  99. print iceCtl.getAllConf(x)
  100. print "--- Ice test end"
  101. '''
  102. print "equal test ---"
  103. print "getBootedServers [%s]" % (dbusCtl.getBootedServers() == iceCtl.getBootedServers())
  104. print "getChannels [%s]" % (dbusCtl.getChannels(x) == iceCtl.getChannels(x))
  105. print "getPlayers [%s]" % (dbusCtl.getPlayers(x) == iceCtl.getPlayers(x))
  106. print "getACL(x, 0) [%s]" % (dbusCtl.getACL(x, 0) == iceCtl.getACL(x, 0))
  107. print "getAllServers [%s]" % (dbusCtl.getAllServers() == iceCtl.getAllServers())
  108. print "getDefaultConf [%s]" % (dbusCtl.getDefaultConf() == iceCtl.getDefaultConf())
  109. print "getAllConf(x) [%s]" % (dbusCtl.getAllConf(x) == iceCtl.getAllConf(x))
  110. print "getRegisteredPlayers(x) [%s]" % (dbusCtl.getRegisteredPlayers(x) == iceCtl.getRegisteredPlayers(x))
  111. #print iceCtl.getRegisteredPlayers(x)
  112. #print iceCtl.getACL(x, 0)