diff --git a/pyproject.toml b/pyproject.toml index f6a80d776..37b0a6a95 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,7 @@ requires-python = ">=3.8" [tool.setuptools] packages = [ "scc", + "scc.bin", "scc.drivers", "scc.lib", "scc.x11", @@ -38,18 +39,18 @@ packages = [ # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#creating-executable-scripts [project.gui-scripts] -sc-controller = "scc.scripts:main" +sc-controller = "scc.bin.sc_controller:main" [project.scripts] -scc-daemon = "scc.scripts.scc_daemon:main" -scc = "scc.scripts.scc:main" -scc-osd-dialog = "scc.scripts.scc_osd_dialog:main" -scc-osd-keyboard = "scc.scripts.scc_osd_keyboard:main" -scc-osd-launcher = "scc.scripts.scc_osd_launcher:main" -scc-osd-menu = "scc.scripts.scc_osd_menu:main" -scc-osd-message = "scc.scripts.scc_osd_message:main" -scc-osd-radial-menu = "scc.scripts.scc_osd_radial_menu:main" -scc-osd-show-bindings = "scc.scripts.scc_osd_show_bindings:main" +scc-daemon = "scc.bin.scc_daemon:main" +#scc = "scc.bin.scc:main" +scc-osd-dialog = "scc.bin.scc_osd_dialog:main" +scc-osd-keyboard = "scc.bin.scc_osd_keyboard:main" +scc-osd-launcher = "scc.bin.scc_osd_launcher:main" +scc-osd-menu = "scc.bin.scc_osd_menu:main" +scc-osd-message = "scc.bin.scc_osd_message:main" +scc-osd-radial-menu = "scc.bin.scc_osd_radial_menu:main" +scc-osd-show-bindings = "scc.bin.scc_osd_show_bindings:main" [tool.ruff] # Target non-EOL releases at minimum, or later if needed diff --git a/scc/bin/__init__.py b/scc/bin/__init__.py new file mode 100644 index 000000000..66d3abff1 --- /dev/null +++ b/scc/bin/__init__.py @@ -0,0 +1 @@ +"""SC-Controller executables.""" diff --git a/scc/bin/sc_controller.py b/scc/bin/sc_controller.py new file mode 100755 index 000000000..00ab40b1a --- /dev/null +++ b/scc/bin/sc_controller.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 +import os +import signal +import sys + + +def main() -> None: + def sigint(*a): + print("\n*break*") + sys.exit(0) + + 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__": + main() diff --git a/scripts/scc-daemon b/scc/bin/scc_daemon.py similarity index 100% rename from scripts/scc-daemon rename to scc/bin/scc_daemon.py diff --git a/scripts/scc-osd-dialog b/scc/bin/scc_osd_dialog.py similarity index 99% rename from scripts/scc-osd-dialog rename to scc/bin/scc_osd_dialog.py index de38fbc07..6550f16ff 100755 --- a/scripts/scc-osd-dialog +++ b/scc/bin/scc_osd_dialog.py @@ -12,11 +12,11 @@ def main(): gi.require_version('Gtk', '3.0') gi.require_version('Rsvg', '2.0') gi.require_version('GdkX11', '3.0') - + from scc.tools import init_logging from scc.paths import get_share_path init_logging() - + from scc.osd.dialog import Dialog m = Dialog() if not m.parse_argumets(sys.argv): diff --git a/scripts/scc-osd-keyboard b/scc/bin/scc_osd_keyboard.py similarity index 100% rename from scripts/scc-osd-keyboard rename to scc/bin/scc_osd_keyboard.py diff --git a/scripts/scc-osd-launcher b/scc/bin/scc_osd_launcher.py similarity index 100% rename from scripts/scc-osd-launcher rename to scc/bin/scc_osd_launcher.py diff --git a/scripts/scc-osd-menu b/scc/bin/scc_osd_menu.py similarity index 100% rename from scripts/scc-osd-menu rename to scc/bin/scc_osd_menu.py diff --git a/scripts/scc-osd-message b/scc/bin/scc_osd_message.py similarity index 100% rename from scripts/scc-osd-message rename to scc/bin/scc_osd_message.py diff --git a/scripts/scc-osd-radial-menu b/scc/bin/scc_osd_radial_menu.py similarity index 100% rename from scripts/scc-osd-radial-menu rename to scc/bin/scc_osd_radial_menu.py diff --git a/scripts/scc-osd-show-bindings b/scc/bin/scc_osd_show_bindings.py similarity index 100% rename from scripts/scc-osd-show-bindings rename to scc/bin/scc_osd_show_bindings.py diff --git a/scc/gui/__init__.py b/scc/gui/__init__.py index e19fc2f85..35934a35e 100644 --- a/scc/gui/__init__.py +++ b/scc/gui/__init__.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 from scc.constants import SCButtons BUTTON_ORDER = ( diff --git a/scripts/sc-controller b/scripts/sc-controller deleted file mode 100755 index 3088e14bc..000000000 --- a/scripts/sc-controller +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python3 -import os -import signal -import sys - - -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__": - main()