comparison toolfactory/rgToolFactory2.py @ 118:e43c43396a70 draft

Uploaded
author fubar
date Fri, 11 Dec 2020 04:23:48 +0000
parents b1a29d3d50d6
children 8ea1133b9d9a
comparison
equal deleted inserted replaced
117:b1a29d3d50d6 118:e43c43396a70
569 if self.args.help_text: 569 if self.args.help_text:
570 helptext = open(self.args.help_text, "r").readlines() 570 helptext = open(self.args.help_text, "r").readlines()
571 safertext = "\n".join([cheetah_escape(x) for x in helptext]) 571 safertext = "\n".join([cheetah_escape(x) for x in helptext])
572 if self.args.script_path: 572 if self.args.script_path:
573 scr = [x for x in self.spacedScript if x.strip() > ""] 573 scr = [x for x in self.spacedScript if x.strip() > ""]
574 scr.insert(0,'\n------\n\nScript::\n') 574 scr.insert(0,'\n------\n\n\nScript::\n')
575 if len(scr) > 300: 575 if len(scr) > 300:
576 scr = ( 576 scr = (
577 scr[:100] 577 scr[:100]
578 + [">300 lines - stuff deleted", "......"] 578 + [" >300 lines - stuff deleted", " ......"]
579 + scr[-100:] 579 + scr[-100:]
580 ) 580 )
581 scr.append('\n') 581 scr.append('\n')
582 safertext = safertext + "\n".join(scr) 582 safertext = safertext + "\n".join(scr)
583 self.newtool.help = safertext 583 self.newtool.help = safertext
988 shutil.copyfile(src, dest) 988 shutil.copyfile(src, dest)
989 989
990 990
991 def main(): 991 def main():
992 """ 992 """
993 This is a Galaxy wrapper. It expects to be called by a special purpose tool.xml as: 993 This is a Galaxy wrapper. It expects to be called by a special purpose tool.xml
994 <command interpreter="python">rgBaseScriptWrapper.py --script_path "$scriptPath" 994
995 --tool_name "foo" --interpreter "Rscript"
996 </command>
997 """ 995 """
998 parser = argparse.ArgumentParser() 996 parser = argparse.ArgumentParser()
999 a = parser.add_argument 997 a = parser.add_argument
1000 a("--script_path", default=None) 998 a("--script_path", default=None)
1001 a("--history_test", default=None) 999 a("--history_test", default=None)