conn paramters added to __repr__ magic methods

add __str__ override (used in logger)
This commit is contained in:
onyx-and-iris 2022-12-05 16:41:34 +00:00
parent 92e2c29bd6
commit cf888b0c4a
2 changed files with 11 additions and 1 deletions

View File

@ -5,7 +5,7 @@ from threading import Thread
from .baseclient import ObsClient from .baseclient import ObsClient
from .callback import Callback from .callback import Callback
from .enum import Subs from .subs import Subs
""" """
A class to interact with obs-websocket events A class to interact with obs-websocket events
@ -28,6 +28,11 @@ class EventClient:
self.subscribe() self.subscribe()
def __repr__(self): def __repr__(self):
return type(self).__name__ + "({host} {port} {password} {subs})".format(
**self.base_client.__dict__
)
def __str__(self):
return type(self).__name__ return type(self).__name__
def subscribe(self): def subscribe(self):

View File

@ -26,6 +26,11 @@ class ReqClient:
self.base_client.ws.close() self.base_client.ws.close()
def __repr__(self): def __repr__(self):
return type(self).__name__ + "({host} {port} {password})".format(
**self.base_client.__dict__
)
def __str__(self):
return type(self).__name__ return type(self).__name__
def send(self, param, data=None, raw=False): def send(self, param, data=None, raw=False):