Fix packaging
This commit is contained in:
parent
449bac079e
commit
d90c2404cd
2 changed files with 9 additions and 4 deletions
|
@ -18,6 +18,10 @@ build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[tool.setuptools]
|
[tool.setuptools]
|
||||||
package-dir = {"" = "src"}
|
package-dir = {"" = "src"}
|
||||||
|
include-package-data = true
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
[tool.setuptools.packages.find]
|
||||||
where = ["src"]
|
where = ["src"]
|
||||||
|
|
||||||
|
[tool.setuptools.package-data]
|
||||||
|
recoder = ["resources.gresource"]
|
|
@ -7,12 +7,13 @@ gi.require_version('Gtk', '4.0')
|
||||||
gi.require_version('Adw', '1')
|
gi.require_version('Adw', '1')
|
||||||
|
|
||||||
from gi.repository import Adw, Gio
|
from gi.repository import Adw, Gio
|
||||||
|
from importlib.resources import files
|
||||||
|
|
||||||
Adw.init()
|
Adw.init()
|
||||||
|
|
||||||
def load_resources():
|
def load_resources():
|
||||||
resource_path = os.path.join(os.path.dirname(__file__), "../resources/resources.gresource")
|
resource_path = files("recoder").joinpath("resources.gresource")
|
||||||
resource = Gio.Resource.load(resource_path)
|
resource = Gio.Resource.load(str(resource_path))
|
||||||
Gio.resources_register(resource)
|
Gio.resources_register(resource)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -28,7 +29,7 @@ def main():
|
||||||
|
|
||||||
def do_activate(self):
|
def do_activate(self):
|
||||||
if not self.window:
|
if not self.window:
|
||||||
self.window = RecoderWindow(application=self)
|
self.window = RecoderWindow(self)
|
||||||
self.window.window.present()
|
self.window.window.present()
|
||||||
|
|
||||||
app = RecoderApp()
|
app = RecoderApp()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue