Skip to content

Commit

Permalink
Fix scripts after pyproject.toml migration
Browse files Browse the repository at this point in the history
  • Loading branch information
C0rn3j committed Sep 28, 2024
1 parent 662f855 commit 5d8aa46
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 48 deletions.
21 changes: 11 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ requires-python = ">=3.8"
[tool.setuptools]
packages = [
"scc",
"scc.bin",
"scc.drivers",
"scc.lib",
"scc.x11",
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions scc/bin/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""SC-Controller executables."""
34 changes: 34 additions & 0 deletions scc/bin/sc_controller.py
Original file line number Diff line number Diff line change
@@ -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()
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/scc-osd-dialog → scc/bin/scc_osd_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion scc/gui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python3
from scc.constants import SCButtons

BUTTON_ORDER = (
Expand Down
35 changes: 0 additions & 35 deletions scripts/sc-controller

This file was deleted.

0 comments on commit 5d8aa46

Please sign in to comment.