Import changes, added method caller
This commit is contained in:
parent
00217b7a8e
commit
03047325b8
|
@ -1,5 +1,5 @@
|
||||||
# Python imports
|
# Python imports
|
||||||
import threading, signal, inspect, os, time
|
import threading, subprocess, time
|
||||||
|
|
||||||
|
|
||||||
# Gtk imports
|
# Gtk imports
|
||||||
|
|
|
@ -9,6 +9,11 @@ from gi.repository import GLib
|
||||||
|
|
||||||
|
|
||||||
class Controller_Data:
|
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):
|
def has_method(self, obj, name):
|
||||||
return callable(getattr(obj, name, None))
|
return callable(getattr(obj, name, None))
|
||||||
|
|
||||||
|
|
|
@ -42,9 +42,9 @@ class Settings:
|
||||||
self._warning_color = "#ffa800"
|
self._warning_color = "#ffa800"
|
||||||
self._error_color = "#ff0000"
|
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)
|
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):
|
if not os.path.exists(self._GLADE_FILE):
|
||||||
self._GLADE_FILE = f"{self._USR_PATH}/Main_Window.glade"
|
self._GLADE_FILE = f"{self._USR_PATH}/Main_Window.glade"
|
||||||
|
|
Loading…
Reference in New Issue