Added clear_console method

This commit is contained in:
itdominator 2022-01-24 21:20:24 -06:00
parent 03047325b8
commit 256c923751
1 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,5 @@
# Python imports # Python imports
import signal import os, signal
# Lib imports # Lib imports
from gi.repository import GLib from gi.repository import GLib
@ -9,6 +9,9 @@ from gi.repository import GLib
class Controller_Data: class Controller_Data:
def clear_console(self):
os.system('cls' if os.name == 'nt' else 'clear')
def call_method(self, _method_name, data = None): def call_method(self, _method_name, data = None):
method_name = str(_method_name) method_name = str(_method_name)
method = getattr(self, method_name, lambda data: f"No valid key passed...\nkey={method_name}\nargs={data}") method = getattr(self, method_name, lambda data: f"No valid key passed...\nkey={method_name}\nargs={data}")