2020-05-08 00:07:33 +00:00
|
|
|
# Python imports
|
|
|
|
import inspect
|
|
|
|
|
|
|
|
|
|
|
|
# Gtk imports
|
|
|
|
|
|
|
|
|
|
|
|
# Application imports
|
|
|
|
from utils import Settings
|
|
|
|
from signal_classes import Signals
|
2021-10-11 04:28:19 +00:00
|
|
|
from __builtins__ import Builtins
|
2020-05-08 00:07:33 +00:00
|
|
|
|
|
|
|
|
2021-10-11 04:28:19 +00:00
|
|
|
class Main(Builtins):
|
2020-05-08 00:07:33 +00:00
|
|
|
def __init__(self, args):
|
|
|
|
settings = Settings()
|
|
|
|
builder = settings.returnBuilder()
|
|
|
|
|
|
|
|
# Gets the methods from the classes and sets to handler.
|
|
|
|
# Then, builder connects to any signals it needs.
|
|
|
|
classes = [Signals(settings)]
|
|
|
|
|
|
|
|
handlers = {}
|
|
|
|
for c in classes:
|
2021-03-18 05:24:08 +00:00
|
|
|
methods = None
|
|
|
|
try:
|
|
|
|
methods = inspect.getmembers(c, predicate=inspect.ismethod)
|
|
|
|
handlers.update(methods)
|
|
|
|
except Exception as e:
|
|
|
|
pass
|
2020-05-08 00:07:33 +00:00
|
|
|
|
|
|
|
builder.connect_signals(handlers)
|
|
|
|
window = settings.createWindow()
|
|
|
|
window.show()
|