mirror of
https://github.com/onyx-and-iris/obsws-python.git
synced 2024-11-21 20:30:54 +00:00
override repr
This commit is contained in:
parent
c3ebc5e777
commit
5e7860d3ed
@ -43,10 +43,13 @@ class EventClient:
|
||||
kwargs = defaultkwargs | kwargs
|
||||
self.base_client = ObsClient(**kwargs)
|
||||
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.subscribe()
|
||||
|
||||
def __repr__(self):
|
||||
return type(self).__name__
|
||||
|
||||
def subscribe(self):
|
||||
worker = Thread(target=self.trigger, daemon=True)
|
||||
worker.start()
|
||||
|
@ -17,7 +17,7 @@ class ReqClient:
|
||||
def __init__(self, **kwargs):
|
||||
self.base_client = ObsClient(**kwargs)
|
||||
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):
|
||||
return self
|
||||
@ -25,6 +25,9 @@ class ReqClient:
|
||||
def __exit__(self, exc_type, exc_value, exc_traceback):
|
||||
self.base_client.ws.close()
|
||||
|
||||
def __repr__(self):
|
||||
return type(self).__name__
|
||||
|
||||
def send(self, param, data=None):
|
||||
response = self.base_client.req(param, data)
|
||||
if not response["requestStatus"]["result"]:
|
||||
|
Loading…
Reference in New Issue
Block a user