Added python project; fixed spelling of folder

This commit is contained in:
2023-09-30 16:09:14 -05:00
parent 1f23cb73d1
commit 6bf66c5916
1075 changed files with 2165 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
#!/usr/bin/python3
# Gtk imports
import gi, faulthandler, signal
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk as gtk
from gi.repository import Gdk as gdk
from gi.repository import GLib
# Python imports
import inspect
from setproctitle import setproctitle
# Application imports
from utils import Settings
from signal_classes import CrossClassSignals, SearchWindow
class AnimeFreakDL:
def __init__(self):
setproctitle('AnimeFreakDL')
GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT, gtk.main_quit)
faulthandler.enable() # For better debug info
settings = Settings()
builder = settings.returnBuilder()
# Gets the methods from the classes and sets to handler.
# Then, builder connects to any signals it needs.
classes = [CrossClassSignals(settings),
SearchWindow(settings)]
handlers = {}
for c in classes:
methods = inspect.getmembers(c, predicate=inspect.ismethod)
handlers.update(methods)
builder.connect_signals(handlers)
window = settings.createWindow()
window.show()
if __name__ == "__main__":
try:
main = AnimeFreakDL()
gtk.main()
except Exception as e:
print(e)