From 13a06941908788b2be7b50a4fb87321eb39fa9e8 Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Wed, 27 Jul 2022 23:19:10 +0100 Subject: [PATCH] changes to to_camel_case and to_snake_case --- obsstudio_sdk/callback.py | 2 +- obsstudio_sdk/util.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) 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"(?