summaryrefslogtreecommitdiff
path: root/python/astal/application.py
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-07-15 22:09:58 +0200
committerAylur <[email protected]>2024-07-15 22:09:58 +0200
commite5251d23f158c7cc092121c3a7cc0438a73746ec (patch)
treedbd972adfb768e5600ca15f779b4cffc666a442f /python/astal/application.py
parentbe163b310398ad7f454d3ece574a476abfa216e9 (diff)
remove python and node
I have no desire to work on the python version The node version has the issue of promises not working which makes it unusable but gjs works just as good if not better. Might look back into node later
Diffstat (limited to 'python/astal/application.py')
-rw-r--r--python/astal/application.py62
1 files changed, 0 insertions, 62 deletions
diff --git a/python/astal/application.py b/python/astal/application.py
deleted file mode 100644
index b5d5c41..0000000
--- a/python/astal/application.py
+++ /dev/null
@@ -1,62 +0,0 @@
-from collections.abc import Callable
-from gi.repository import Astal, Gio
-
-RequestHandler = Callable[[str, Callable[[str], None]], None]
-
-
-class _Application(Astal.Application):
- def __init__(self) -> None:
- super().__init__()
- self.request_handler: RequestHandler | None = None
-
- def do_request(self, msg: str, conn: Gio.SocketConnection) -> None:
- if self.request_handler:
- self.request_handler(
- msg,
- lambda response: Astal.write_sock(
- conn,
- str(response),
- lambda _, res: Astal.write_sock_finish(res),
- ),
- )
- else:
- super().do_request(msg, conn)
-
- def start(
- self,
- instance_name: str | None = None,
- gtk_theme: str | None = None,
- icon_theme: str | None = None,
- cursor_theme: str | None = None,
- css: str | None = None,
- hold: bool | None = True,
- request_handler: RequestHandler | None = None,
- callback: Callable | None = None,
- ) -> None:
- if request_handler:
- self.request_handler = request_handler
- if hold:
- self.hold()
- if instance_name:
- self.instance_name = instance_name
- if gtk_theme:
- self.gtk_theme = gtk_theme
- if icon_theme:
- self.icon_theme = icon_theme
- if cursor_theme:
- self.cursor_theme = icon_theme
- if css:
- self.apply_css(css, False)
- if not self.acquire_socket():
- print(f"Astal instance {self.instance_name} already running")
- return
-
- def on_activate(app):
- if callback:
- callback()
-
- self.connect("activate", on_activate)
- self.run()
-
-
-App = _Application()