Skip to content

Commit 88978e1

Browse files
committed
improve path loading from within module
Signed-off-by: Zen <[email protected]>
1 parent e2ef02a commit 88978e1

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
version=version,
88
description="A simple initramfs generator",
99
author="desultory",
10+
package_data={
11+
"ugrd": ["*/*.toml"]
12+
},
1013
entry_points={
1114
"console_scripts": [
1215
"ugrd = ugrd.main:main"

ugrd/initramfs_dict.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
__author__ = "desultory"
3-
__version__ = "0.7.0"
3+
__version__ = "0.7.1"
44

55
from tomllib import load
66
from pathlib import Path
@@ -209,7 +209,10 @@ def _process_modules(self, module):
209209
"""
210210
self.logger.debug("Processing module: %s" % module)
211211

212-
with open(f"{module.replace('.', '/')}.toml", 'rb') as module_file:
212+
module_path = Path(__file__).parent.parent / (module.replace('.', '/') + '.toml')
213+
self.logger.debug("Module path: %s" % module_path)
214+
215+
with open(module_path, 'rb') as module_file:
213216
module_config = load(module_file)
214217
self.logger.debug("[%s] Loaded module config: %s" % (module, module_config))
215218

ugrd/initramfs_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
__author__ = "desultory"
3-
__version__ = "0.6.0"
3+
__version__ = "0.6.1"
44

55
from tomllib import load
66
from pathlib import Path

0 commit comments

Comments
 (0)