Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tuneit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
tuneit
Commits
629b819a
Commit
629b819a
authored
Jan 12, 2025
by
Anton Palgunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: load from ~/.local/share/tuneit
parent
cd0795d7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
7 deletions
+51
-7
ru.ximperlinux.TuteIt.json
ru.ximperlinux.TuteIt.json
+30
-1
__init__.py
src/settings/__init__.py
+2
-5
yml_tools.py
src/settings/tools/yml_tools.py
+19
-1
No files found.
ru.ximperlinux.TuteIt.json
View file @
629b819a
...
...
@@ -9,7 +9,8 @@
"--share=ipc"
,
"--socket=fallback-x11"
,
"--device=dri"
,
"--socket=wayland"
"--socket=wayland"
,
"--filesystem=home"
],
"cleanup"
:
[
"/include"
,
...
...
@@ -35,6 +36,34 @@
]
},
{
"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"
,
...
...
src/settings/__init__.py
View file @
629b819a
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
...
...
@@ -155,11 +155,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
()
...
...
src/settings/tools/yml_tools.py
View file @
629b819a
...
...
@@ -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
())
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment