mirror of
https://github.com/onyx-and-iris/obsws-python.git
synced 2024-11-22 12:50:53 +00:00
dict expansion for defaultkwarg
This commit is contained in:
parent
051b5898a2
commit
00a97b1d8b
@ -12,8 +12,10 @@ class ObsClient(object):
|
||||
DELAY = 0.001
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
defaultkwargs = {key: None for key in ["host", "port", "password"]}
|
||||
defaultkwargs["subs"] = 0
|
||||
defaultkwargs = {
|
||||
**{key: None for key in ["host", "port", "password"]},
|
||||
"subs": 0,
|
||||
}
|
||||
kwargs = defaultkwargs | kwargs
|
||||
for attr, val in kwargs.items():
|
||||
setattr(self, attr, val)
|
||||
|
@ -23,8 +23,8 @@ class EventClient(object):
|
||||
DELAY = 0.001
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
defaultkwargs = dict()
|
||||
defaultkwargs["subs"] = (
|
||||
defaultkwargs = {
|
||||
"subs": (
|
||||
(1 << Subs.general)
|
||||
| (1 << Subs.config)
|
||||
| (1 << Subs.scenes)
|
||||
@ -37,6 +37,7 @@ class EventClient(object):
|
||||
| (1 << Subs.vendors)
|
||||
| (1 << Subs.ui)
|
||||
)
|
||||
}
|
||||
kwargs = defaultkwargs | kwargs
|
||||
self.base_client = ObsClient(**kwargs)
|
||||
self.base_client.authenticate()
|
||||
|
Loading…
Reference in New Issue
Block a user