Use galaxy directory helper to determine template path

This commit is contained in:
guerler
2025-06-14 06:06:37 -04:00
parent 3e83a25f02
commit d6fc3b68b9
2 changed files with 8 additions and 3 deletions
+8 -2
View File
@@ -66,10 +66,15 @@ from galaxy.tool_util.deps.containers import NullContainerFinder
from galaxy.tools import ToolBox
from galaxy.tools.cache import ToolCache
from galaxy.tools.data import ToolDataTableManager
from galaxy.util import StructuredExecutionTimer
from galaxy.util import (
galaxy_directory,
StructuredExecutionTimer,
)
from galaxy.util.bunch import Bunch
from galaxy.web_stack import ApplicationStack
glx_dir = galaxy_directory()
# =============================================================================
def buildMockEnviron(**kwargs):
@@ -376,7 +381,8 @@ class MockTrans:
def fill_template(self, filename, template_lookup=None, **kwargs):
if template_lookup is None:
template_lookup = mako.lookup.TemplateLookup(directories="templates/")
template_path = os.path.join(glx_dir, "templates")
template_lookup = mako.lookup.TemplateLookup(directories=template_path)
template = template_lookup.get_template(filename)
kwargs.update(h=MockTemplateHelpers())
return template.render(**kwargs)
@@ -18,7 +18,6 @@ from . import VisualizationsBase_TestCase
glx_dir = galaxy_directory()
template_cache_dir = os.path.join(glx_dir, "database", "compiled_templates")
additional_templates_dir = os.path.join(glx_dir, "config", "plugins", "visualizations", "common", "templates")
vis_reg_path = "config/plugins/visualizations"
config1 = """\