Import changes, added method caller

This commit is contained in:
2022-01-24 20:58:41 -06:00
parent 00217b7a8e
commit 03047325b8
3 changed files with 8 additions and 3 deletions

View File

@@ -9,6 +9,11 @@ from gi.repository import GLib
class Controller_Data:
def call_method(self, _method_name, data = None):
method_name = str(_method_name)
method = getattr(self, method_name, lambda data: f"No valid key passed...\nkey={method_name}\nargs={data}")
return method(data) if data else method()
def has_method(self, obj, name):
return callable(getattr(obj, name, None))