Skip to content

Commit 8a47310

Browse files
only use 1st line of description
for Galaxy tool description see OpenMS/OpenMS#6568
1 parent d11eb1c commit 8a47310

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

ctdconverter/galaxy/converter.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,11 @@ def create_description(tool, model):
561561
"""
562562
if "description" in model.opt_attribs.keys() and model.opt_attribs["description"] is not None:
563563
description = SubElement(tool, "description")
564-
description.text = model.opt_attribs["description"]
564+
text = model.opt_attribs["description"]
565+
text = text.split("\n")[0].strip()
566+
if text[-1] == ".":
567+
text = text[:-1]
568+
description.text = text
565569

566570

567571
def create_configfiles(tool, model, **kwargs):

tests/test-data/bool.ctd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<tool ctdVersion="1.7" version="2.3.0" name="bool" docurl="http://www.openms.de/unavailable.html" category="Test" >
3-
<description><![CDATA[Bool parameter tests]]></description>
3+
<description><![CDATA[Bool parameter tests
4+
5+
Some additional text that must not appear in the Galaxy tool description.
6+
]]></description>
47
<manual><![CDATA[Bool parameter tests.]]></manual>
58
<PARAMETERS version="1.6.2" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/OpenMS/OpenMS/develop/share/OpenMS/SCHEMAS/Param_1_6_2.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
69
<NODE name="BoolTest" description="Bool test.">

0 commit comments

Comments
 (0)