[elbe-devel] [PATCH 07/19] elbepack: drop xsdtoasciidoc_mako_fname

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Mar 19 08:47:36 CET 2024


Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/commands/xsdtoasciidoc.py | 6 ++++--
 elbepack/directories.py            | 2 --
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/elbepack/commands/xsdtoasciidoc.py b/elbepack/commands/xsdtoasciidoc.py
index 3658d844aa8a..b73e6d4bd0bd 100644
--- a/elbepack/commands/xsdtoasciidoc.py
+++ b/elbepack/commands/xsdtoasciidoc.py
@@ -2,10 +2,11 @@
 # SPDX-License-Identifier: GPL-3.0-or-later
 # SPDX-FileCopyrightText: 2013-2017 Linutronix GmbH
 
+import importlib.resources
 import sys
 from optparse import OptionParser
 
-from elbepack.directories import xsdtoasciidoc_mako_fname
+import elbepack
 from elbepack.templates import write_template
 from elbepack.treeutils import etree
 
@@ -34,4 +35,5 @@ def run_command(argv):
     d = {'opt': opt,
          'xml': xml}
 
-    write_template(opt.out, xsdtoasciidoc_mako_fname, d)
+    template = importlib.resources.files(elbepack) / 'xsdtoasciidoc.mako'
+    write_template(opt.out, template, d)
diff --git a/elbepack/directories.py b/elbepack/directories.py
index 49bf9d2538f0..2754dc025af3 100644
--- a/elbepack/directories.py
+++ b/elbepack/directories.py
@@ -22,8 +22,6 @@ def get_cmdlist():
 
 pack_dir = elbepack.__path__[0]
 
-xsdtoasciidoc_mako_fname = os.path.join(pack_dir, 'xsdtoasciidoc.mako')
-
 
 def run_elbe(args, **kwargs):
     return subprocess.run([sys.executable, elbe_exe, *args], **kwargs)

-- 
2.44.0



More information about the elbe-devel mailing list