48 lines
1.2 KiB
Python
48 lines
1.2 KiB
Python
|
|
"""
|
||
|
|
This file is part of the SplendidBear Websites' projects.
|
||
|
|
|
||
|
|
Copyright (c) 2026 @ www.splendidbear.org
|
||
|
|
|
||
|
|
For the full copyright and license information, please view the LICENSE
|
||
|
|
file that was distributed with this source code.
|
||
|
|
"""
|
||
|
|
|
||
|
|
import sys
|
||
|
|
import logging
|
||
|
|
|
||
|
|
import gi
|
||
|
|
gi.require_version("Gtk", "4.0")
|
||
|
|
gi.require_version("Adw", "1")
|
||
|
|
gi.require_version("Gst", "1.0")
|
||
|
|
from gi.repository import Gtk, Adw, Gst, GLib
|
||
|
|
|
||
|
|
# Validate config early (raises EnvironmentError if .env is missing)
|
||
|
|
from mineseeker import config # noqa: F401
|
||
|
|
|
||
|
|
logging.basicConfig(
|
||
|
|
level=logging.INFO,
|
||
|
|
format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
|
||
|
|
)
|
||
|
|
|
||
|
|
|
||
|
|
class MineSeekerApp(Adw.Application):
|
||
|
|
def __init__(self) -> None:
|
||
|
|
super().__init__(application_id="org.splendidbear.mineseeker")
|
||
|
|
self.connect("activate", self._on_activate)
|
||
|
|
|
||
|
|
def _on_activate(self, app: Adw.Application) -> None:
|
||
|
|
# Import here so GTK/Adw is already initialised before building widgets
|
||
|
|
from mineseeker.ui.app_window import AppWindow
|
||
|
|
window = AppWindow(application=app)
|
||
|
|
window.present()
|
||
|
|
|
||
|
|
|
||
|
|
def main() -> int:
|
||
|
|
Gst.init(None)
|
||
|
|
app = MineSeekerApp()
|
||
|
|
return app.run(sys.argv)
|
||
|
|
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
sys.exit(main())
|