changeset 7:61381bad936d draft

Uploaded
author fubar
date Mon, 12 Jan 2015 05:01:29 -0500
parents 81198714ac8e
children 9d58cc32a12d
files rgToolFactory2.py tool_dependencies.xml
diffstat 2 files changed, 28 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/rgToolFactory2.py	Sun Jan 11 23:34:39 2015 -0500
+++ b/rgToolFactory2.py	Mon Jan 12 05:01:29 2015 -0500
@@ -145,11 +145,16 @@
      "<": "&lt;",
      "$": "\$"
      }
-
+html_unescape_table = dict(zip(html_escape_table.values(),html_escape_table.keys()))
 def html_escape(text):
      """Produce entities within text."""
      return "".join(html_escape_table.get(c,c) for c in text)
 
+
+def html_unescape(text):
+     """Revert entities within text."""
+     return "".join(html_unescape_table.get(c,c) for c in text)
+     
 def cmd_exists(cmd):
      return subprocess.call("type " + cmd, shell=True, 
            stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0
@@ -245,8 +250,10 @@
                 a('--OUTPATH "%s"' % self.opts.output_tab) 
             for p in opts.additional_parameters:
                 p = p.replace('"','')
-                ps = p.split(',')
-                a('%s="%s"' % (ps[0],ps[1]))
+                psplit = p.split(',')
+                param = html_unescape(psplit[0])
+                value = html_unescape(psplit[1])
+                a('%s="%s"' % (param,value))
         if (self.opts.interpreter == 'Rscript'):
             # pass params on command line
             if self.opts.input_tab:
@@ -256,8 +263,10 @@
                 a('OUTPATH="%s"' % self.opts.output_tab) 
             for p in opts.additional_parameters:
                 p = p.replace('"','')
-                ps = p.split(',')
-                a('%s="%s"' % (ps[0],ps[1]))
+                psplit = p.split(',')
+                param = html_unescape(psplit[0])
+                value = html_unescape(psplit[1])
+                a('%s="%s"' % (param,value))
         if (self.opts.interpreter == 'perl'):
             # pass params on command line
             if self.opts.input_tab:
@@ -267,9 +276,9 @@
                 a('%s' % self.opts.output_tab)
             for p in opts.additional_parameters:
                 p = p.replace('"','')
-                ps = p.split(',')
-                param = ps[0]
-                value = ps[1]
+                psplit = p.split(',')
+                param = html_unescape(psplit[0])
+                value = html_unescape(psplit[1])
                 if (value.find(' ') <> -1):
                     a('%s="%s"' % (param,value))
                 else:
@@ -285,16 +294,16 @@
                   a('OUTPATH=%s' % (self.opts.output_tab))
               # sets those environment variables for the script
               # additional params appear in CL - yes, it's confusing
-              for i,param in enumerate(opts.additional_parameters):
-                  psplit = param.split(',')
-                  n = psplit[0]
-                  v = psplit[1]
-                  if (v.find(' ') <> -1):
-                    a('%s="%s"' % (n,v))
-                    self.cl.insert(4+i,'%s="%s"' % (n,v))
+              for i,p in enumerate(opts.additional_parameters):
+                  psplit = p.split(',')
+                  param = html_unescape(psplit[0])
+                  value = html_unescape(psplit[1])
+                  if (value.find(' ') <> -1):
+                    a('%s="%s"' % (param,value))
+                    self.cl.insert(4+i,'%s="%s"' % (param,value))
                   else:
-                    a('%s=%s' % (n,v))
-                    self.cl.insert(4+i,'%s=%s' % (n,v))
+                    a('%s=%s' % (param,value))
+                    self.cl.insert(4+i,'%s=%s' % (param,value))
 
 
         self.outFormats = opts.output_format
--- a/tool_dependencies.xml	Sun Jan 11 23:34:39 2015 -0500
+++ b/tool_dependencies.xml	Mon Jan 12 05:01:29 2015 -0500
@@ -1,10 +1,10 @@
 <?xml version="1.0"?>
 <tool_dependency>
     <package name="ghostscript" version="9.10">
-        <repository changeset_revision="a285e78179bd" name="package_ghostscript_9_10" owner="devteam" toolshed="http://toolshed.g2.bx.psu.edu/" />
+        <repository changeset_revision="a285e78179bd" name="package_ghostscript_9_10" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
     <package name="graphicsmagick" version="1.3.20">
-        <repository changeset_revision="d87c457bbbc2" name="package_graphicsmagick_1_3_20" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu/" />
+        <repository changeset_revision="d87c457bbbc2" name="package_graphicsmagick_1_3_20" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
         <readme>
             Only Admins can use this tool generator but please do NOT install on a public facing Galaxy as it exposes unrestricted scripting as your Galaxy user