diff --git a/scripts/sc-controller b/scripts/sc-controller index 3ea7766e..3088e14b 100755 --- a/scripts/sc-controller +++ b/scripts/sc-controller @@ -1,28 +1,35 @@ #!/usr/bin/env python3 -import os, sys, signal +import os +import signal +import sys -def sigint(*a): - print("\n*break*") - sys.exit(0) + +def main() -> None: + def sigint(*a): + print("\n*break*") + sys.exit(0) + + if __name__ == "__main__": + signal.signal(signal.SIGINT, sigint) + + import gi + gi.require_version('Gtk', '3.0') + gi.require_version('GdkX11', '3.0') + gi.require_version('Rsvg', '2.0') + + from scc.paths import get_share_path + from scc.tools import init_logging + init_logging() + + from gi.repository import Gtk, GObject + glades = os.path.join(get_share_path(), "glade") + images = os.path.join(get_share_path(), "images") + if Gtk.IconTheme.get_default(): + Gtk.IconTheme.get_default().append_search_path(images) + #GObject.threads_init() + + from scc.gui.app import App + App(glades, images).run(sys.argv) if __name__ == "__main__": - signal.signal(signal.SIGINT, sigint) - - import gi - gi.require_version('Gtk', '3.0') - gi.require_version('GdkX11', '3.0') - gi.require_version('Rsvg', '2.0') - - from scc.tools import init_logging - from scc.paths import get_share_path - init_logging() - - from gi.repository import Gtk, GObject - glades = os.path.join(get_share_path(), "glade") - images = os.path.join(get_share_path(), "images") - if Gtk.IconTheme.get_default(): - Gtk.IconTheme.get_default().append_search_path(images) - #GObject.threads_init() - - from scc.gui.app import App - App(glades, images).run(sys.argv) + main() diff --git a/scripts/scc b/scripts/scc index 9b67cfba..ab0997c0 100755 --- a/scripts/scc +++ b/scripts/scc @@ -1,9 +1,9 @@ #!/usr/bin/env python3 -""" -Script that integrates everything SCC can do in one executable. +"""Script that integrates everything SCC can do in one executable. + Created so scc-* stuff doesn't polute /usr/bin. """ from scc.scripts import main -if __name__ == '__main__': +if __name__ == "__main__": main()