From 2382bbcce9ef9966af3a90534e8a1438f5f4f5e6 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Mon, 29 Jul 2024 12:57:56 +0200 Subject: [PATCH] add missing file --- planemo/linters/util.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 planemo/linters/util.py diff --git a/planemo/linters/util.py b/planemo/linters/util.py new file mode 100644 index 000000000..eeab46235 --- /dev/null +++ b/planemo/linters/util.py @@ -0,0 +1,16 @@ +from typing import ( + Optional, + TYPE_CHECKING, +) + +if TYPE_CHECKING: + from galaxy.tool_util.parser.interface import ToolSource + from galaxy.util import Element + + +def xml_node_from_toolsource(tool_source: "ToolSource", tag: "str") -> Optional["Element"]: + node = None + xml_tree = getattr(tool_source, "xml_tree", None) + if xml_tree: + node = root.find(tag) + return node \ No newline at end of file