Mercurial > repos > tduigou > json_db_config_generating
diff json_db_config_generating.xml @ 1:2909e53fac5b draft
planemo upload for repository https://github.com/brsynth commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
| author | tduigou |
|---|---|
| date | Mon, 02 Jun 2025 14:54:24 +0000 |
| parents | 95757ea6c333 |
| children | 33ebf3ea3eb6 |
line wrap: on
line diff
--- a/json_db_config_generating.xml Mon Jun 02 13:39:41 2025 +0000 +++ b/json_db_config_generating.xml Mon Jun 02 14:54:24 2025 +0000 @@ -12,15 +12,33 @@ 'JSON_fragment_column': '$fragment_column', 'JSON_sequence_column': '$sequence_column', 'JSON_annotation_column': '$annotation_column' - }; f = open('$output_json', 'w'); json.dump(params, f, indent=4); f.close()" + }; f = open('$output_json', 'w'); json.dump(params, f, indent=4); f.close()" && echo DEBG && cat '$output_json' ]]></command> <inputs> - <param name="execution" type="boolean" label="execution key" checked="False" help="If True the execution key in the json file will be true" optional="true" /> - <param name="db_uri" type="text" label="DB Connection URI" optional="true" /> - <param name="table_name" type="text" label="DB Table Name" optional="true" /> - <param name="fragment_column" type="text" label="DB IDs Column Name" optional="true" /> - <param name="sequence_column" type="text" label="DB Column Contains Sequence For ganbank File" optional="true" /> - <param name="annotation_column" type="text" label="DB Column Contains Annotation For Ganbank File" optional="true" /> + <conditional name="db_request"> + <param name="execution" type="select" label="Save To DB ?" help="If True the execution key in the json file will be true" optional="false"> + <option value="false" selected="True">NO</option> + <option value="true">YES</option> + </param> + <when value='true'> + <section name='db_config' title='DB config' expanded='true'> + <param name="db_uri" type="text" label="DB Connection URI" optional="true" /> + <param name="table_name" type="text" label="DB Table Name" optional="true" /> + <param name="fragment_column" type="text" label="DB IDs Column Name" optional="true" /> + <param name="sequence_column" type="text" label="DB Column Contains Sequence For ganbank File" optional="true" /> + <param name="annotation_column" type="text" label="DB Column Contains Annotation For Ganbank File" optional="true" /> + </section> + </when> + <when value='false'> + <section name='db_config' title='DB config' expanded='false'> + <param name="db_uri" type="text" label="DB Connection URI" optional="true" /> + <param name="table_name" type="text" label="DB Table Name" optional="true" /> + <param name="fragment_column" type="text" label="DB IDs Column Name" optional="true" /> + <param name="sequence_column" type="text" label="DB Column Contains Sequence For ganbank File" optional="true" /> + <param name="annotation_column" type="text" label="DB Column Contains Annotation For Ganbank File" optional="true" /> + </section> + </when> + </conditional> </inputs> <outputs> <data name="output_json" format="json" label="JSON Conf" /> @@ -28,12 +46,14 @@ <tests> <!--test execution is true --> <test> - <param name="execution" value="True" /> - <param name="db_uri" value="postgresql://postgres:RK17@localhost:5432/test_fragments_db" /> - <param name="table_name" value="sample" /> - <param name="fragment_column" value="fragment" /> - <param name="sequence_column" value="sequence" /> - <param name="annotation_column" value="annotation" /> + <conditional name="db_request"> + <param name="execution" value="true" /> + <param name="db_config|db_uri" value="postgresql://postgres:RK17@localhost:5432/test_fragments_db" /> + <param name="db_config|table_name" value="sample" /> + <param name="db_config|fragment_column" value="fragment" /> + <param name="db_config|sequence_column" value="sequence" /> + <param name="db_config|annotation_column" value="annotation" /> + </conditional> <output name="output_json"> <assert_contents> <has_json_property_with_text property="execution" text="true" /> @@ -47,20 +67,17 @@ </test> <!--test execution is false --> <test> - <param name="execution" value="False" /> - <param name="db_uri" value="postgresql://postgres:RK17@localhost:5432/test_fragments_db" /> - <param name="table_name" value="sample" /> - <param name="fragment_column" value="fragment" /> - <param name="sequence_column" value="sequence" /> - <param name="annotation_column" value="annotation" /> + <conditional name="db_request"> + <param name="execution" value="false" /> + </conditional> <output name="output_json"> <assert_contents> <has_json_property_with_text property="execution" text="false" /> - <has_json_property_with_text property="JSON_db_uri" text="postgresql://postgres:RK17__at__localhost:5432/test_fragments_db" /> - <has_json_property_with_text property="JSON_table" text="sample" /> - <has_json_property_with_text property="JSON_fragment_column" text="fragment" /> - <has_json_property_with_text property="JSON_sequence_column" text="sequence" /> - <has_json_property_with_text property="JSON_annotation_column" text="annotation" /> + <has_json_property_with_text property="JSON_db_uri" text="" /> + <has_json_property_with_text property="JSON_table" text="" /> + <has_json_property_with_text property="JSON_fragment_column" text="" /> + <has_json_property_with_text property="JSON_sequence_column" text="" /> + <has_json_property_with_text property="JSON_annotation_column" text="" /> </assert_contents> </output> </test>
