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
34825230
Commit
34825230
authored
Jan 21, 2025
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
load modules from /usr/share/tuneit/modules/ but local modules are a priority.
parent
8c1759b4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
14 deletions
+26
-14
ru.ximperlinux.TuneIt.gschema.xml
data/ru.ximperlinux.TuneIt.gschema.xml
+4
-0
exampleplug.yml
modules/exampleplug/exampleplug.yml
+0
-0
meson.build
modules/meson.build
+2
-2
yml_tools.py
src/settings/tools/yml_tools.py
+20
-12
No files found.
data/ru.ximperlinux.TuneIt.gschema.xml
View file @
34825230
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<schemalist
gettext-domain=
"tuneit"
>
<schemalist
gettext-domain=
"tuneit"
>
<schema
id=
"ru.ximperlinux.TuneIt"
path=
"/ru.ximperlinux.TuneIt/"
>
<schema
id=
"ru.ximperlinux.TuneIt"
path=
"/ru.ximperlinux.TuneIt/"
>
<key
name=
"show_root_modules"
type=
"b"
>
<default>
false
</default>
<description>
Show modules that require root permissions
</description>
</key>
</schema>
</schema>
</schemalist>
</schemalist>
modules/exampleplug.yml
→
modules/exampleplug
/exampleplug
.yml
View file @
34825230
File moved
modules/meson.build
View file @
34825230
pluginsdir = pkgdatadir / 'modules'
pluginsdir = pkgdatadir / 'modules'
plugins = [
plugins = [
'exampleplug
.yml
',
'exampleplug',
]
]
install_
data
(plugins, install_dir: pluginsdir)
install_
subdir
(plugins, install_dir: pluginsdir)
src/settings/tools/yml_tools.py
View file @
34825230
...
@@ -2,22 +2,31 @@ import os
...
@@ -2,22 +2,31 @@ import os
import
yaml
import
yaml
def
get_local_
shar
e_directory
():
def
get_local_
modul
e_directory
():
home_directory
=
os
.
path
.
expanduser
(
"~"
)
home_directory
=
os
.
path
.
expanduser
(
"~"
)
local_share_directory
=
os
.
path
.
join
(
home_directory
,
".local"
,
"share"
,
"tuneit"
)
return
os
.
path
.
join
(
home_directory
,
".local"
,
"share"
,
"tuneit"
,
"modules"
)
return
local_share_directory
def
get_module_directory
():
return
"/usr/share/tuneit/modules"
def
load_modules
():
def
load_modules
():
modules
=
[]
modules
=
[]
local_share_directory
=
get_local_share_directory
()
local_modules_directory
=
get_local_module_directory
()
global_modules_directory
=
get_module_directory
()
modules_directory
=
os
.
path
.
join
(
local_share_directory
,
"modules"
)
if
not
os
.
path
.
exists
(
modules_directory
):
all_modules
=
set
(
os
.
listdir
(
global_modules_directory
))
print
(
f
"Директория {modules_directory} не существует"
)
return
modules
for
module_name
in
os
.
listdir
(
local_modules_directory
):
module_path
=
os
.
path
.
join
(
local_modules_directory
,
module_name
)
modules
=
load_yaml_files_from_directory
(
modules_directory
)
if
os
.
path
.
isdir
(
module_path
):
modules
+=
load_yaml_files_from_directory
(
module_path
)
all_modules
.
discard
(
module_name
)
for
module_name
in
all_modules
:
module_path
=
os
.
path
.
join
(
global_modules_directory
,
module_name
)
if
os
.
path
.
isdir
(
module_path
):
modules
+=
load_yaml_files_from_directory
(
module_path
)
return
modules
return
modules
def
load_yaml_files_from_directory
(
directory
):
def
load_yaml_files_from_directory
(
directory
):
...
@@ -35,7 +44,6 @@ def load_yaml_files_from_directory(directory):
...
@@ -35,7 +44,6 @@ def load_yaml_files_from_directory(directory):
print
(
f
"Ошибка при чтении файла {file_path}: {e}"
)
print
(
f
"Ошибка при чтении файла {file_path}: {e}"
)
return
yaml_data
return
yaml_data
def
merge_categories_by_name
(
categories_data
):
def
merge_categories_by_name
(
categories_data
):
categories_dict
=
{}
categories_dict
=
{}
for
category_data
in
categories_data
:
for
category_data
in
categories_data
:
...
...
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