mirror of
https://github.com/onyx-and-iris/obsws-python.git
synced 2024-11-22 04:40:53 +00:00
override repr
This commit is contained in:
parent
c3ebc5e777
commit
5e7860d3ed
@ -43,10 +43,13 @@ class EventClient:
|
|||||||
kwargs = defaultkwargs | kwargs
|
kwargs = defaultkwargs | kwargs
|
||||||
self.base_client = ObsClient(**kwargs)
|
self.base_client = ObsClient(**kwargs)
|
||||||
if self.base_client.authenticate():
|
if self.base_client.authenticate():
|
||||||
self.logger.info("Successfully identified client with the server")
|
self.logger.info(f"Successfully identified {self} with the server")
|
||||||
self.callback = Callback()
|
self.callback = Callback()
|
||||||
self.subscribe()
|
self.subscribe()
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return type(self).__name__
|
||||||
|
|
||||||
def subscribe(self):
|
def subscribe(self):
|
||||||
worker = Thread(target=self.trigger, daemon=True)
|
worker = Thread(target=self.trigger, daemon=True)
|
||||||
worker.start()
|
worker.start()
|
||||||
|
@ -17,7 +17,7 @@ class ReqClient:
|
|||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
self.base_client = ObsClient(**kwargs)
|
self.base_client = ObsClient(**kwargs)
|
||||||
if self.base_client.authenticate():
|
if self.base_client.authenticate():
|
||||||
self.logger.info("Successfully identified client with the server")
|
self.logger.info(f"Successfully identified {self} with the server")
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
return self
|
return self
|
||||||
@ -25,6 +25,9 @@ class ReqClient:
|
|||||||
def __exit__(self, exc_type, exc_value, exc_traceback):
|
def __exit__(self, exc_type, exc_value, exc_traceback):
|
||||||
self.base_client.ws.close()
|
self.base_client.ws.close()
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return type(self).__name__
|
||||||
|
|
||||||
def send(self, param, data=None):
|
def send(self, param, data=None):
|
||||||
response = self.base_client.req(param, data)
|
response = self.base_client.req(param, data)
|
||||||
if not response["requestStatus"]["result"]:
|
if not response["requestStatus"]["result"]:
|
||||||
|
Loading…
Reference in New Issue
Block a user