diff --git a/obsstudio_sdk/callback.py b/obsstudio_sdk/callback.py index 9015997..8aa9a0c 100644 --- a/obsstudio_sdk/callback.py +++ b/obsstudio_sdk/callback.py @@ -14,7 +14,7 @@ class Callback: def get(self) -> list: """returns a list of registered events""" - return [to_camel_case(fn.__name__) for fn in self._callbacks] + return [to_camel_case(fn.__name__[2:]) for fn in self._callbacks] def trigger(self, event, data): """trigger callback on update""" diff --git a/obsstudio_sdk/util.py b/obsstudio_sdk/util.py index 59dbcc3..51fe39a 100644 --- a/obsstudio_sdk/util.py +++ b/obsstudio_sdk/util.py @@ -3,13 +3,11 @@ from dataclasses import dataclass def to_camel_case(s): - s = "".join(word.title() for word in s.split("_")) - return s[2:] + return "".join(word.title() for word in s.split("_")) def to_snake_case(s): - s = re.sub(r"(?