Import changes, added method caller

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

View File

@ -1,5 +1,5 @@
# Python imports
import threading, signal, inspect, os, time
import threading, subprocess, time
# Gtk imports

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))

View File

@ -42,9 +42,9 @@ class Settings:
self._warning_color = "#ffa800"
self._error_color = "#ff0000"
if not os.path.exists(self._GLADE_FILE):
if not os.path.exists(self._CONFIG_PATH):
os.mkdir(self._CONFIG_PATH)
self._logger = Logger(self._CONFIG_PATH).get_logger()
self._logger = Logger(self._CONFIG_PATH).get_logger()
if not os.path.exists(self._GLADE_FILE):
self._GLADE_FILE = f"{self._USR_PATH}/Main_Window.glade"