mirror of
https://github.com/onyx-and-iris/obsws-python.git
synced 2024-11-22 04:40:53 +00:00
adds disconnect() method to ReqClient
now calling disconnect() in __exit__()
This commit is contained in:
parent
4654d2529f
commit
f1c2efa4a1
@ -31,7 +31,7 @@ class ReqClient:
|
|||||||
return self
|
return self
|
||||||
|
|
||||||
def __exit__(self, exc_type, exc_value, exc_traceback):
|
def __exit__(self, exc_type, exc_value, exc_traceback):
|
||||||
self.base_client.ws.close()
|
self.disconnect()
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return type(
|
return type(
|
||||||
@ -43,6 +43,9 @@ class ReqClient:
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return type(self).__name__
|
return type(self).__name__
|
||||||
|
|
||||||
|
def disconnect(self):
|
||||||
|
self.base_client.ws.close()
|
||||||
|
|
||||||
def send(self, param, data=None, raw=False):
|
def send(self, param, data=None, raw=False):
|
||||||
try:
|
try:
|
||||||
response = self.base_client.req(param, data)
|
response = self.base_client.req(param, data)
|
||||||
|
Loading…
Reference in New Issue
Block a user