Skip to content

Commit

Permalink
Styling
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinugu committed Aug 23, 2023
1 parent 0fa3508 commit fcbf388
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 6 additions & 2 deletions lib/galaxy/tool_util/parser/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,13 @@ def parse_environment_variables(self):
# TODO: refactor - horrible code
if inject:
assert inject_validates(inject)
assert not template if inject != "entry_point_path" else template, "Cannot specify inject and environment variable template."
assert (
not template if inject != "entry_point_path" else template
), "Cannot specify inject and environment variable template."
if template:
assert not inject or inject == "entry_point_path", "Cannot specify inject and environment variable template."
assert (
not inject or inject == "entry_point_path"
), "Cannot specify inject and environment variable template."
definition = {
"name": environment_variable_el.get("name"),
"template": template,
Expand Down
7 changes: 3 additions & 4 deletions lib/galaxy/tools/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,14 +660,13 @@ def _build_environment_variables(self):
is_template = False
elif inject and inject == "entry_point_path" and environment_variable_template:
from galaxy.managers.interactivetool import InteractiveToolManager

entry_point_name = environment_variable_template
matching_eps = [ep for ep in
self.job.interactivetool_entry_points if
ep.name == entry_point_name]
matching_eps = [ep for ep in self.job.interactivetool_entry_points if ep.name == entry_point_name]
if matching_eps:
entry_point = matching_eps[0]
entry_point_path = InteractiveToolManager(self.app).get_entry_point_path(self.app, entry_point)
environment_variable_template = entry_point_path.rstrip('/')
environment_variable_template = entry_point_path.rstrip("/")
else:
environment_variable_template = ""
is_template = False
Expand Down

0 comments on commit fcbf388

Please sign in to comment.