|
@ -22,11 +22,11 @@ from zlib import compress, decompress |
|
|
from mctl import MumbleCtlBase |
|
|
from mctl import MumbleCtlBase |
|
|
|
|
|
|
|
|
import dbus |
|
|
import dbus |
|
|
|
|
|
|
|
|
class MumbleCtlDbus(MumbleCtlBase): |
|
|
class MumbleCtlDbus(MumbleCtlBase): |
|
|
method = "DBus"; |
|
|
method = "DBus"; |
|
|
|
|
|
|
|
|
def __init__( self, connstring ): |
|
|
def __init__( self, connstring ): |
|
|
# Prior to saving the model, connect to murmur via dbus and update its settings. |
|
|
|
|
|
self.dbus_base = connstring; |
|
|
self.dbus_base = connstring; |
|
|
self.meta = self._getDbusMeta(); |
|
|
self.meta = self._getDbusMeta(); |
|
|
|
|
|
|
|
@ -34,10 +34,8 @@ class MumbleCtlDbus(MumbleCtlBase): |
|
|
return dbus.Interface( dbus.SystemBus().get_object( self.dbus_base, '/' ), 'net.sourceforge.mumble.Meta' ); |
|
|
return dbus.Interface( dbus.SystemBus().get_object( self.dbus_base, '/' ), 'net.sourceforge.mumble.Meta' ); |
|
|
|
|
|
|
|
|
def _getDbusServerObject( self, srvid): |
|
|
def _getDbusServerObject( self, srvid): |
|
|
"Connects to DBus and returns an mmServer object representing this Murmur instance." |
|
|
|
|
|
|
|
|
|
|
|
if srvid not in self.getBootedServers(): |
|
|
if srvid not in self.getBootedServers(): |
|
|
raise Exception, 'No murmur process with the given server ID (%d) is running and attached to system dbus under %s.' % ( srvid, self.meta ); |
|
|
|
|
|
|
|
|
raise SystemError, 'No murmur process with the given server ID (%d) is running and attached to system dbus under %s.' % ( srvid, self.meta ); |
|
|
|
|
|
|
|
|
return dbus.Interface( dbus.SystemBus().get_object( self.dbus_base, '/%d' % srvid ), 'net.sourceforge.mumble.Murmur' ); |
|
|
return dbus.Interface( dbus.SystemBus().get_object( self.dbus_base, '/%d' % srvid ), 'net.sourceforge.mumble.Murmur' ); |
|
|
|
|
|
|
|
@ -104,7 +102,6 @@ class MumbleCtlDbus(MumbleCtlBase): |
|
|
|
|
|
|
|
|
def setRegistration(self, srvid, mumbleid, name, email, password): |
|
|
def setRegistration(self, srvid, mumbleid, name, email, password): |
|
|
return MumbleCtlDbus.converDbusTypeToNative(self._getDbusServerObject(srvid).setRegistration(dbus.Int32(mumbleid), name, email, password)) |
|
|
return MumbleCtlDbus.converDbusTypeToNative(self._getDbusServerObject(srvid).setRegistration(dbus.Int32(mumbleid), name, email, password)) |
|
|
#return MumbleCtlDbus.converDbusTypeToNative(self._getDbusServerObject(srvid).setRegistration(dbus.Int32(mumbleid), dbus.String(name), dbus.String(email), dbus.String(password))) |
|
|
|
|
|
|
|
|
|
|
|
def getTexture(self, srvid, mumbleid): |
|
|
def getTexture(self, srvid, mumbleid): |
|
|
texture = self._getDbusServerObject(srvid).getTexture(dbus.Int32(mumbleid)); |
|
|
texture = self._getDbusServerObject(srvid).getTexture(dbus.Int32(mumbleid)); |
|
@ -170,3 +167,5 @@ class MumbleCtlDbus(MumbleCtlBase): |
|
|
elif data.__class__ is dbus.Byte: |
|
|
elif data.__class__ is dbus.Byte: |
|
|
ret = byte(data) |
|
|
ret = byte(data) |
|
|
return ret |
|
|
return ret |
|
|
|
|
|
|
|
|
|
|
|
|