changeset 10:71f2ac0eee95

Updated tarball with some test material - still need code generated... Completed a round trip test via a local toolshed. Awsome
author ross lazarus ross.lazarus@gmail.com
date Sat, 02 Jun 2012 22:40:33 +1000
parents e09c76551bed
children a0a5d0757e39
files rgToolFactory.py rgToolFactory.xml
diffstat 2 files changed, 35 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/rgToolFactory.py	Sat Jun 02 21:08:57 2012 +1000
+++ b/rgToolFactory.py	Sat Jun 02 22:40:33 2012 +1000
@@ -1,11 +1,13 @@
-# rgDynamicScriptWrapper.py
-# derived from
+# rgToolFactory.py
+# derived from 
 # rgBaseScriptWrapper.py
-# to run some user supplied code 
-# extremely dangerous
+# but designed to run arbitrary user supplied code 
+# extremely dangerous!!
 # trusted users only - private site only
-# a list in the xml is searched - only users in the list can run this tool.
-# 
+# a list in the xml is searched for users permitted to run this tool.
+# DO NOT install on a public or important site - local instance only
+# generated tools are fine as they just run normally and their user cannot do anything unusually insecure
+#
 # copyright ross lazarus (ross.lazarus@gmail.com) May 2012
 # 
 # all rights reserved
@@ -170,6 +172,15 @@
         self.makeXML()
         tdir = self.toolname
         os.mkdir(tdir)
+        if self.opts.input_tab: # we may have test data?
+            testdir = os.path.join(tdir,'test-data')
+            os.mkdir(testdir) # make tests directory
+            shutil.copyfile(self.opts.input_tab,os.path.join(testdir,'test1_in.tab'))
+            if self.opts.output_tab:
+                shutil.copyfile(self.opts.output_tab,os.path.join(testdir,'test1_out.tab'))
+            if self.opts.make_HTML:
+                shutil.copyfile(self.opts.output_html,os.path.join(testdir,'test1_out.html'))
+                shutil.copyfile(self.opts.tlog,os.path.join(testdir,'test1_out.log'))
         shutil.copyfile(self.xmlfile,os.path.join(tdir,self.xmlfile))
         shutil.copyfile(self.pyfile,os.path.join(tdir,'%s.py' % self.toolname))
         shutil.copyfile(self.sfile,os.path.join(tdir,self.sfile))
--- a/rgToolFactory.xml	Sat Jun 02 21:08:57 2012 +1000
+++ b/rgToolFactory.xml	Sat Jun 02 22:40:33 2012 +1000
@@ -9,7 +9,7 @@
     #if $make_HTML.value=="yes" or $factory.make_Tool=="yes":
       --output_dir "$html_file.files_path" --output_html "$html_file"
     #end if
-    #if $input1.value != 'None':
+    #if $input1 != 'None':
        --input_tab "$input1"
     #end if
     #if $make_HTML.value=="yes":
@@ -74,7 +74,7 @@
         <filter> make_TAB=="yes" </filter>
     </data>
     <data format="html" name="html_file" label="${tool_name}.html">
-        <filter> make_HTML=="yes" or make_Tool=="yes"</filter>
+        <filter>make_HTML=="yes" or factory.make_Tool=="yes"</filter>
     </data>
   </outputs>
 <configfiles>
@@ -91,21 +91,24 @@
 <help>
 **What it does**
 This tool enables a user to paste and submit an arbitrary R/python/perl script to run in Galaxy.
-This is (extremely) insecure. However, once you get the script working on some test data, you can generate a complete ready to run
-Galaxy tool by setting the "Make tool" option to Yes. The resulting tarball will be ready to install
-It will run like as securely as any other Galaxy tool - unlike this one used to generate it.
 
 **Restrictions**
 This tool will ONLY work if your user id has been added to the local copy's list of permitted users.
 It should only ever be used on a private, personal Galaxy instance and you should edit this tool's source so your local login
-is authorised to use it - == it will not run otherwise ==
+is authorised to use it - *it will not run otherwise*
+
+.. class:: warningmark
+
+**Note to system administrators** Under no circumstances should you allow any user to use this tool unless you really, really trust them to do
+no harm. This tool (extremely) insecure and is only recommended for private/personnal Galaxy instances.
 
-**Note to system administrators**
-Under no circumstances should you allow any user to use this tool unless you really, really trust them to do
-no harm.
+Once you get the script working on some test data, you can generate a complete ready to run
+Galaxy tool by setting the "Make tool" option to Yes. The resulting tarball will be ready to install
+It will run just as securely as any other normal Galaxy tool - unlike this one used to generate it.
 
-**Use on public servers** 
-is STRONGLY discouraged for obvious reasons
+.. class:: warningmark
+
+**Use on public servers**  is STRONGLY discouraged for obvious reasons
 
 **Scripting conventions**
 The pasted script will be executed. 
@@ -137,7 +140,10 @@
  heatmap(bar,main='Random Heatmap')
  dev.off()
 
-
+**Attribution**
+Copyright ross lazarus (ross.lazarus at gmail stop com) May 2012 
+All rights reserved
+Licensed under the LGPL for your pleasure
 </help>
 
 </tool>