Mercurial > repos > triasteran > py2_patch
changeset 0:46274846fc0c draft default tip
Uploaded
author | triasteran |
---|---|
date | Mon, 07 Mar 2022 14:46:55 +0000 |
parents | |
children | |
files | PY2_PATCH/py2_patch.xml PY2_PATCH/script.py PY2_PATCH/test-data/input.txt |
diffstat | 3 files changed, 44 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PY2_PATCH/py2_patch.xml Mon Mar 07 14:46:55 2022 +0000 @@ -0,0 +1,24 @@ +<tool id="py2_patch_test" name="py2" version="0.1.0"> + <requirements> + <requirement type="package" version="1.0.0">bowtie</requirement> + </requirements> + <command detect_errors="exit_code"><![CDATA[ + python2 '$__tool_directory__/script.py' -a '$input1' > '$output1' + ]]></command> + <inputs> + <param type="data" name="input1" format="txt" /> + </inputs> + <outputs> + <data name="output1" format="txt" /> + </outputs> +<tests> + <test> + <param name="input1" value="input.txt"/> + <output name="output1" file="output.txt"/> + </test> + </tests> + <help><![CDATA[ + TODO: Fill in help. + ]]></help> +</tool> +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PY2_PATCH/script.py Mon Mar 07 14:46:55 2022 +0000 @@ -0,0 +1,15 @@ +import sys +print 'script starts!' + +input1 = sys.argv[1] +output1 = sys.argv[2] + +I = open(input1, 'r') +O = open(output1, 'w') + +for f in I.readlines(): + O.write(f+'1'+'\n') + +O.close() +I.close() +