changeset 3:87ae77f2bd5a draft default tip

planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/ocean commit ecc01d1975d2a603ece634c6cfe2d9591b307cc8
author ecology
date Thu, 20 Mar 2025 14:49:58 +0000
parents c07f11d8e49a
children
files check.py copernicusmarine.xml
diffstat 2 files changed, 17 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/check.py	Mon Nov 18 10:39:18 2024 +0000
+++ b/check.py	Thu Mar 20 14:49:58 2025 +0000
@@ -76,6 +76,10 @@
         print(error_message)
         sys.exit(1)
 
+    # Append '--force-download' option to the command
+    if "--force-download" not in command:
+        command += " --force-download"
+
     # Execute the command
     try:
         subprocess.run(command, shell=True, check=True)
--- a/copernicusmarine.xml	Mon Nov 18 10:39:18 2024 +0000
+++ b/copernicusmarine.xml	Thu Mar 20 14:49:58 2025 +0000
@@ -2,45 +2,28 @@
     <description>retrieve marine data</description>
     <macros>
         <token name="@TOOL_VERSION@">1.3.3</token>
-        <token name="@VERSION_SUFFIX@">1</token>
+        <token name="@VERSION_SUFFIX@">2</token>
     </macros>
     <requirements>
         <requirement type="package" version="@TOOL_VERSION@">copernicusmarine</requirement>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
-    #import re
-        #set $cmems_username = $__user__.extra_preferences.get('cmems_account|cmems_username', "")
-        #set $cmems_password = $__user__.extra_preferences.get('cmems_account|cmems_password', "")
-
-        #if $cmems_username == "" or $cmems_password == ""
-            #set $cmems_username = os.getenv('CMEMS_USERNAME', '')
-            #set $cmems_password = os.getenv('CMEMS_PASSWORD', '')
-
-            echo "Using global ENVs" &&
-
-            #if re.match(r"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$", $cmems_password):
-                echo "Password meets the required criteria" &&
-            #else:
-                echo "Password does not meet the required criteria" &&
-            #end if
-
-        #end if
-
-        #if $cmems_username == ""
-            echo 'Error. Set your CMEMS credentials via: User -> Preferences -> Manage Information'  &&
-        #end if
+        bash '$cmems_credentials' &&
         
-        #set $filename="config_file_with_my_command"
-        echo -e '$input_text' > $filename --force-download --username $cmems_username --password $cmems_password &&
-
-        python '$__tool_directory__/check.py' $filename
+        echo -e '$input_text' > config_file_with_my_command &&
+        python '$__tool_directory__/check.py' 'config_file_with_my_command'
     ]]></command>
     <configfiles>
         <configfile name="cmems_credentials">
-            #set $cmems_username = $__user__.extra_preferences.get('cmems_username', "")
-            #set $cmems_password = $__user__.extra_preferences.get('cmems_password', "")
-            cmems_username: $cmems_username
-            cmems_password: $cmems_password
+#import os 
+#set $cmems_username = $__user__.extra_preferences.get('cmems_username', "")
+#set $cmems_password = $__user__.extra_preferences.get('cmems_password', "")
+#if $cmems_username == "" or $cmems_password == ""
+    #set $cmems_username = os.getenv('CMEMS_USERNAME', '')
+    #set $cmems_password = os.getenv('CMEMS_PASSWORD', '')
+#end if
+export cmems_username='$cmems_username'
+export cmems_password='$cmems_password'
         </configfile>
     </configfiles>
     <inputs>