changeset 3:c9459a7e08ff draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/add_input_name_as_column commit 1775d01920f27931a1935e233766f615d753502b
author iuc
date Tue, 14 Oct 2025 17:12:53 +0000
parents ea4ad41e01fc
children
files add_input_name_as_column.py add_input_name_as_column.xml
diffstat 2 files changed, 30 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/add_input_name_as_column.py	Wed Mar 25 11:09:05 2020 +0000
+++ b/add_input_name_as_column.py	Tue Oct 14 17:12:53 2025 +0000
@@ -4,11 +4,28 @@
 
 def Parser():
     the_parser = argparse.ArgumentParser(description="add label to last column of file")
-    the_parser.add_argument('--input', required=True, action="store", type=str, help="input tabular file")
-    the_parser.add_argument('--output', required=True, action="store", type=str, help="output file path")
-    the_parser.add_argument('--label', required=True, action="store", type=str, help="label to add in last column")
-    the_parser.add_argument('--header', action="store", type=str, help="column label for last column")
-    the_parser.add_argument('--prepend', action='store_true', default=False, help='Prepend column instead of appending' )
+    the_parser.add_argument(
+        "--input", required=True, action="store", type=str, help="input tabular file"
+    )
+    the_parser.add_argument(
+        "--output", required=True, action="store", type=str, help="output file path"
+    )
+    the_parser.add_argument(
+        "--label",
+        required=True,
+        action="store",
+        type=str,
+        help="label to add in last column",
+    )
+    the_parser.add_argument(
+        "--header", action="store", type=str, help="column label for last column"
+    )
+    the_parser.add_argument(
+        "--prepend",
+        action="store_true",
+        default=False,
+        help="Prepend column instead of appending",
+    )
 
     args = the_parser.parse_args()
     return args
@@ -17,9 +34,11 @@
 args = Parser()
 
 
-with io.open(args.input, encoding="utf-8") as input, io.open(args.output, 'w', encoding="utf-8") as output:
+with io.open(args.input, encoding="utf-8") as input, io.open(
+    args.output, "w", encoding="utf-8"
+) as output:
     for i, line in enumerate(input):
-        line = line.strip('\n')
+        line = line.strip("\n")
         if (i == 0) and args.header:
             new_entry = args.header
         else:
--- a/add_input_name_as_column.xml	Wed Mar 25 11:09:05 2020 +0000
+++ b/add_input_name_as_column.xml	Tue Oct 14 17:12:53 2025 +0000
@@ -3,8 +3,11 @@
     <requirements>
         <requirement type="package" version="3.7">python</requirement>
     </requirements>
+    <required_files>
+        <include path="add_input_name_as_column.py"/>
+    </required_files>
     <command><![CDATA[
-python '$__tool_directory__/'add_input_name_as_column.py
+python '$__tool_directory__/add_input_name_as_column.py'
 --input '$input'
 --label '$input.element_identifier'
 --output '$output'