Add support for pip again

This commit is contained in:
Stephen Horvath
2025-03-20 16:16:43 +10:00
parent 35e325b133
commit 754fbd868b
10 changed files with 57 additions and 21 deletions

View File

@@ -1 +1,9 @@
from . import main
import os
# Register resources if not running in Flatpak
if not os.environ.get('FLATPAK_ID'):
from gi.repository import Gio
resource = Gio.Resource.load(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'yafi.gresource'))
resource._register()
from .main import main

View File

@@ -1,3 +0,0 @@
from . import main
main.main()

View File

@@ -62,6 +62,8 @@ class HardwarePage(Gtk.Box):
else:
self.hw_fp_pwr.set_visible(False)
self._update_hardware(app)
# Schedule _update_hardware to run every second
GLib.timeout_add_seconds(1, self._update_hardware, app)

View File

@@ -36,6 +36,7 @@ from .hardware import HardwarePage
from cros_ec_python import get_cros_ec
class YafiApplication(Adw.Application):
"""The main application singleton class."""
@@ -134,7 +135,7 @@ class YafiApplication(Adw.Application):
dialog.present(self.win)
def main(version):
def main():
"""The application's entry point."""
app = YafiApplication()
return app.run(sys.argv)

BIN
yafi/yafi.gresource Normal file

Binary file not shown.

View File

@@ -26,7 +26,7 @@ import signal
import locale
import gettext
VERSION = '@VERSION@'
# VERSION = '@VERSION@'
pkgdatadir = '@pkgdatadir@'
localedir = '@localedir@'
@@ -44,4 +44,4 @@ if __name__ == '__main__':
resource._register()
from yafi import main
sys.exit(main.main(VERSION))
sys.exit(main.main())