Commit e71e0247 authored by Roman Alifanov's avatar Roman Alifanov

Merge branch 'fix-build' into 'master'

Fix build See merge request !1
parents 06d878a9 629b819a
project('ximper-tuneit',
project('tuneit',
version: '0.1.0',
meson_version: '>= 1.0.0',
default_options: [ 'warning_level=2', 'werror=false', ],
......
......@@ -9,7 +9,8 @@
"--share=ipc",
"--socket=fallback-x11",
"--device=dri",
"--socket=wayland"
"--socket=wayland",
"--filesystem=home"
],
"cleanup" : [
"/include",
......@@ -24,6 +25,45 @@
],
"modules" : [
{
"name": "blueprint-compiler",
"buildsystem": "meson",
"sources": [
{
"type": "git",
"url": "https://gitlab.gnome.org/jwestman/blueprint-compiler",
"branch": "main"
}
]
},
{
"name": "python3-docutils",
"buildsystem": "simple",
"build-commands": [
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"docutils\" --no-build-isolation"
],
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/26/87/f238c0670b94533ac0353a4e2a1a771a0cc73277b88bff23d3ae35a256c1/docutils-0.20.1-py3-none-any.whl",
"sha256": "96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6"
}
]
},
{
"name": "python3-PyYAML",
"buildsystem": "simple",
"build-commands": [
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"PyYAML\" --no-build-isolation"
],
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/54/ed/79a089b6be93607fa5cdaedf301d7dfb23af5f25c398d5ead2525b063e17/pyyaml-6.0.2.tar.gz",
"sha512": "a675e0056bb6af9119c7f2796e349ced05afca64118a5b444d66dafcb6a774cf274eeba7eab044b86eb6c12a9d7c785c654f6cf229e1d190340dd06ea76e25ec"
}
]
},
{
"name" : "tuneit",
"builddir" : true,
"buildsystem" : "meson",
......
......@@ -28,7 +28,7 @@ conf.set('pkgdatadir', pkgdatadir)
configure_file(
input: 'tuneit.in',
output: 'ximper-tuneit',
output: 'tuneit',
configuration: conf,
install: true,
install_dir: get_option('bindir'),
......
from gi.repository import Adw, Gtk
from .backends import backend_factory
from .tools.yml_tools import load_yaml_files_from_directory, merge_categories_by_name
from .tools.yml_tools import load_modules, merge_categories_by_name
from .widgets import WidgetFactory
......@@ -166,11 +166,8 @@ class Category:
stack_page.set_title(self.name)
stack_page.set_name(self.name)
def init_settings_stack(stack, listbox, split_view):
yaml_files_directory = "/usr/share/ximper-tuneit/modules" # Укажите путь к папке с YAML файлами
yaml_data = load_yaml_files_from_directory(yaml_files_directory)
yaml_data = load_modules()
merged_data = merge_categories_by_name(yaml_data)
section_factory = SectionFactory()
......
......@@ -2,6 +2,23 @@ import os
import yaml
def get_local_share_directory():
home_directory = os.path.expanduser("~")
local_share_directory = os.path.join(home_directory, ".local", "share", "tuneit")
return local_share_directory
def load_modules():
modules = []
local_share_directory = get_local_share_directory()
modules_directory = os.path.join(local_share_directory, "modules")
if not os.path.exists(modules_directory):
print(f"Директория {modules_directory} не существует")
return modules
modules = load_yaml_files_from_directory(modules_directory)
return modules
def load_yaml_files_from_directory(directory):
yaml_data = []
......@@ -26,6 +43,7 @@ def merge_categories_by_name(categories_data):
if category_name not in categories_dict:
categories_dict[category_name] = category_data
else:
categories_dict[category_name]['sections'].extend(category_data['sections'])
categories_dict[category_name]['sections'].extend(
category_data['sections'])
return list(categories_dict.values())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment