Removed send_command and renamed send_recv_command.

This commit is contained in:
2010-07-11 02:34:37 +01:00
parent e5df902481
commit a595892fbb

11
ts3.py
View File

@@ -60,9 +60,6 @@ class TS3Proto():
cmd = self.construct_command(command, keys=keys, opts=opts) cmd = self.construct_command(command, keys=keys, opts=opts)
self.send('%s\n' % cmd) self.send('%s\n' % cmd)
def send_recv_command(self, command, keys=None, opts=None):
self.send_command(command, keys, opts)
ret = [] ret = []
while True: while True:
@@ -230,7 +227,7 @@ class TS3Server(TS3Proto):
@param password: Password @param password: Password
@type password: str @type password: str
""" """
d = p.send_recv_command('login', keys={'client_login_name': username, 'client_login_password': password }) d = p.send_command('login', keys={'client_login_name': username, 'client_login_password': password })
if d > 0: if d > 0:
self._log.error('Error logging in') self._log.error('Error logging in')
return False return False
@@ -243,7 +240,7 @@ class TS3Server(TS3Proto):
Get a list of all Virtual Servers on the connected TS3 instance Get a list of all Virtual Servers on the connected TS3 instance
""" """
if self._connected: if self._connected:
return self.send_recv_command('serverlist') return self.send_command('serverlist')
def gm(self, msg): def gm(self, msg):
""" """
@@ -253,7 +250,7 @@ class TS3Server(TS3Proto):
@type ip: str @type ip: str
""" """
if self._connected: if self._connected:
return self.send_recv_command('gm', keys={'msg': msg}) return self.send_command('gm', keys={'msg': msg})
def use(self, id): def use(self, id):
""" """
@@ -263,7 +260,7 @@ class TS3Server(TS3Proto):
@type id: int @type id: int
""" """
if self._connected and id > 0: if self._connected and id > 0:
self.send_recv_command('use', keys={'sid': id}) self.send_command('use', keys={'sid': id})
if __name__ == '__main__': if __name__ == '__main__':