mirror of
https://github.com/nikdoof/python-ts3.git
synced 2026-02-01 10:38:14 +00:00
return response data always as a list for
This commit is contained in:
12
ts3.py
12
ts3.py
@@ -58,12 +58,14 @@ class TS3Response():
|
|||||||
self.response = TS3Proto.parse_command(response)
|
self.response = TS3Proto.parse_command(response)
|
||||||
self.data = TS3Proto.parse_command(data)
|
self.data = TS3Proto.parse_command(data)
|
||||||
|
|
||||||
def is_successful(self):
|
if isinstance(self.data, dict):
|
||||||
if isinstance(self.response, dict):
|
if self.data:
|
||||||
return self.response['keys']['msg'] == 'ok'
|
self.data = [self.data]
|
||||||
|
else:
|
||||||
|
self.data = []
|
||||||
|
|
||||||
# if the response is a list, it has to be successful
|
def is_successful(self):
|
||||||
return True
|
return self.response['keys']['msg'] == 'ok'
|
||||||
|
|
||||||
class TS3Proto():
|
class TS3Proto():
|
||||||
def connect(self, ip, port, timeout=5):
|
def connect(self, ip, port, timeout=5):
|
||||||
|
|||||||
Reference in New Issue
Block a user