diff rgToolFactory.py @ 17:903e3748f735 draft

removed dependencies
author fubar
date Sun, 23 Mar 2014 07:12:47 -0400
parents 824d21b5c773
children a986c9f88d38
line wrap: on
line diff
--- a/rgToolFactory.py	Thu Mar 20 06:18:54 2014 -0400
+++ b/rgToolFactory.py	Sun Mar 23 07:12:47 2014 -0400
@@ -157,6 +157,7 @@
         self.xmlfile = '%s.xml' % self.toolname
         s = open(self.opts.script_path,'r').readlines()
         s = [x.rstrip() for x in s] # remove pesky dos line endings if needed
+        s = [x.lstrip() for x in s] # and left padding
         self.script = '\n'.join(s)
         fhandle,self.sfile = tempfile.mkstemp(prefix=self.toolname,suffix=".%s" % (opts.interpreter))
         tscript = open(self.sfile,'w') # use self.sfile as script source for Popen
@@ -254,7 +255,9 @@
             </configfiles>
             %(tooltests)s
             <help>
+            
             %(help)s
+            
             </help>
             </tool>""" # needs a dict with toolname, toolid, interpreter, scriptname, command, inputs as a multi line string ready to write, outputs ditto, help ditto
 
@@ -300,8 +303,9 @@
         # 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']])
         else:
-            xdict['help'] = 'Please ask the tool author for help as none was supplied at tool generation'
+            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::']
         coda.append(self.indentedScript)
         coda.append('**Attribution** This Galaxy tool was created by %s at %s\nusing the Galaxy Tool Factory.' % (self.opts.user_email,timenow()))