changeset 19:4bfe405f76ed draft

Uploaded
author fubar
date Sun, 23 Mar 2014 07:46:57 -0400
parents a986c9f88d38
children 812871c1eaec
files rgToolFactory.py
diffstat 1 files changed, 21 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/rgToolFactory.py	Sun Mar 23 07:28:32 2014 -0400
+++ b/rgToolFactory.py	Sun Mar 23 07:46:57 2014 -0400
@@ -255,7 +255,9 @@
             %(script)s
             </configfile>
             </configfiles>
+            
             %(tooltests)s
+            
             <help>
             
             %(help)s
@@ -267,25 +269,36 @@
             %(toolname)s.py --script_path "$runMe" --interpreter "%(interpreter)s" 
             --tool_name "%(toolname)s" %(command_inputs)s %(command_outputs)s 
             </command>""" # may NOT be an input or htmlout
-        tooltestsTabOnly = """<tests><test>
+        tooltestsTabOnly = """
+        <tests>
+        <test>
         <param name="input1" value="%(test1Input)s" ftype="tabular"/>
         <param name="job_name" value="test1"/>
         <param name="runMe" value="$runMe"/>
         <output name="tab_file" file="%(test1Output)s" ftype="tabular"/>
-        </test></tests>"""
-        tooltestsHTMLOnly = """<tests><test>
+        </test>
+        </tests>
+        """
+        tooltestsHTMLOnly = """
+        <tests>
+        <test>
         <param name="input1" value="%(test1Input)s" ftype="tabular"/>
         <param name="job_name" value="test1"/>
         <param name="runMe" value="$runMe"/>
         <output name="html_file" file="%(test1HTML)s" ftype="html" lines_diff="5"/>
-        </test></tests>"""
-        tooltestsBoth = """<tests><test>
+        </test>
+        </tests>
+        """
+        tooltestsBoth = """<tests>
+        <test>
         <param name="input1" value="%(test1Input)s" ftype="tabular"/>
         <param name="job_name" value="test1"/>
         <param name="runMe" value="$runMe"/>
         <output name="tab_file" file="%(test1Output)s" ftype="tabular" />
         <output name="html_file" file="%(test1HTML)s" ftype="html" lines_diff="10"/>
-        </test></tests>"""
+        </test>
+        </tests>
+        """
         xdict = {}
         xdict['requirements'] = ''
         if self.opts.make_HTML:
@@ -304,8 +317,8 @@
         # configfile is least painful way to embed script to avoid external dependencies
         # but requires escaping of <, > and $ to avoid Mako parsing
         if self.opts.help_text:
-            xdict['help'] = open(self.opts.help_text,'r').read()
-            xdict['help'] = '\n'.join([x.lstrip(x) for x in xdict['help']])
+            xdict['help'] = open(self.opts.help_text,'r').readlines()
+            xdict['help'] = ''.join([x.lstrip(x) for x in xdict['help']])
         else:
             xdict['help'] = 'Please ask the tool author for help as none was supplied at tool generation\n'
         coda = ['**Script**','Pressing execute will run the following code over your input file and generate some outputs in your history::']