Changeset 81

Show
Ignore:
Timestamp:
28-01-11 14:23:01 (3 years ago)
Author:
kostas.karasavvas@…
Message:

v0.2.2 -- allows multi-line input in Galaxy and properly sanitises Galaxy's newline (crcn) to \n before sending to the taverna server

Location:
galaxy-taverna/workflow-to-galaxy
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • galaxy-taverna/workflow-to-galaxy/lib/workflow-to-galaxy/generator.rb

    r80 r81  
    5050        out.write indent(3) + "</when>\n" 
    5151        out.write indent(3) + "<when value=\"textfield\">\n" 
    52         out.write indent(4) + "<param name=\"textfield_#{i.name}\" type=\"text\" size=\"30\" " 
     52        out.write indent(4) + "<param name=\"textfield_#{i.name}\" type=\"text\" area=\"True\" size=\"2x50\" " 
    5353        if i.examples.size >= 1  
    54           # escape double quotes characters for galaxy's xml file 
     54          # escape double quotes characters and add <BR> for newlines for galaxy's xml file 
    5555          ex = i.examples[0].to_s.gsub('"', '&quot;') 
     56          # convert newlines to HTML newlines to display in textareas inputs 
     57          ex = ex.gsub(/[\n]/, '&#xA;') 
    5658          out.write "value=\"#{ex}\" "           
    5759        end 
     
    151153              "before running it via Galaxy.\n\n" 
    152154 
     155    out.write "-----\n\n" 
     156    out.write ".. class:: warningmark\n\n" 
     157    out.write "**Please note that there might be some repetitions in the workflow description** " << 
     158              "in some of the generated workflows. This is due to a backwards compatibility " << 
     159              "issue on the myExperiment repository which keeps the old descriptions to make " << 
     160              "sure that no information is lost.\n\n" 
    153161 
    154162    out.write "-----\n\n" 
     
    197205 
    198206# 
    199 # Sanitize single and double quotes in str. E.g. galaxy substitutes them to 
    200 # __sq__ and __dq__ respectively. This methods turns them back to their 
    201 # original values before using them 
     207# Sanitize single quotes, double quotes, at symbol and newline in str. E.g. Galaxy 
     208# substitutes them to __sq__, __dq__, __at__ and __cr____cn__ respectively. This 
     209# methods turns them back to their original values before using them (i.e. 
     210# sending them to the taverna server 
    202211# 
    203212def sanitize(string) 
    204   string.gsub(/(__sq__|__dq__|__at__)/) do 
     213  string.gsub(/(__sq__|__dq__|__at__|__cr____cn__)/) do 
    205214    if $1 == '__sq__' 
    206215      "'" 
    207216    elsif $1 == '__dq__' 
    208217      '\\\"' 
     218    elsif $1 == '__cr____cn__' 
     219      '\n' 
    209220    else 
    210221      '@' 
  • galaxy-taverna/workflow-to-galaxy/Rakefile

    r79 r81  
    1313spec = Gem::Specification.new do |s| 
    1414  s.name = 'workflow-to-galaxy' 
    15   s.version = '0.2.1' 
     15  s.version = '0.2.2' 
    1616  s.has_rdoc = true 
    1717  s.extra_rdoc_files = ['README', 'LICENSE']