Mercurial > repos > fubar > toolfactory
comparison rgToolFactory.py @ 15:824d21b5c773 draft
Uploaded
author | fubar |
---|---|
date | Thu, 20 Mar 2014 06:09:56 -0400 |
parents | 43ab59672f78 |
children | 903e3748f735 |
comparison
equal
deleted
inserted
replaced
14:43ab59672f78 | 15:824d21b5c773 |
---|---|
88 myversion = 'V001.1 March 2014' | 88 myversion = 'V001.1 March 2014' |
89 verbose = False | 89 verbose = False |
90 debug = False | 90 debug = False |
91 toolFactoryURL = 'https://bitbucket.org/fubar/galaxytoolfactory' | 91 toolFactoryURL = 'https://bitbucket.org/fubar/galaxytoolfactory' |
92 | 92 |
93 # if we do html we need these dependencies | 93 # if we do html we need these dependencies specified in a tool_dependencies.xml file and referred to in the generated |
94 # tool xml | |
94 toolhtmldepskel = """<?xml version="1.0"?> | 95 toolhtmldepskel = """<?xml version="1.0"?> |
95 <tool_dependency> | 96 <tool_dependency> |
96 <package name="ghostscript" version="9.10"> | 97 <package name="ghostscript" version="9.10"> |
97 <repository name="package_ghostscript_9_10" owner="devteam" prior_installation_required="True" toolshed="http://toolshed.g2.bx.psu.edu/" /> | 98 <repository name="package_ghostscript_9_10" owner="devteam" prior_installation_required="True" toolshed="http://toolshed.g2.bx.psu.edu/" /> |
98 </package> | 99 </package> |
102 <readme> | 103 <readme> |
103 %s | 104 %s |
104 </readme> | 105 </readme> |
105 </tool_dependency> | 106 </tool_dependency> |
106 """ | 107 """ |
108 | |
109 protorequirements = """<requirements> | |
110 <requirement type="package" version="9.10">ghostscript</requirement> | |
111 <requirement type="package" version="1.3.18">graphicsmagick</requirement> | |
112 </requirements>""" | |
107 | 113 |
108 def timenow(): | 114 def timenow(): |
109 """return current time as a string | 115 """return current time as a string |
110 """ | 116 """ |
111 return time.strftime('%d/%m/%Y %H:%M:%S', time.localtime(time.time())) | 117 return time.strftime('%d/%m/%Y %H:%M:%S', time.localtime(time.time())) |
231 </tool> | 237 </tool> |
232 | 238 |
233 """ | 239 """ |
234 newXML="""<tool id="%(toolid)s" name="%(toolname)s" version="%(tool_version)s"> | 240 newXML="""<tool id="%(toolid)s" name="%(toolname)s" version="%(tool_version)s"> |
235 %(tooldesc)s | 241 %(tooldesc)s |
242 %(requirements)s | |
236 %(command)s | 243 %(command)s |
237 <inputs> | 244 <inputs> |
238 %(inputs)s | 245 %(inputs)s |
239 </inputs> | 246 </inputs> |
240 <outputs> | 247 <outputs> |
273 <param name="runMe" value="$runMe"/> | 280 <param name="runMe" value="$runMe"/> |
274 <output name="tab_file" file="%(test1Output)s" ftype="tabular" /> | 281 <output name="tab_file" file="%(test1Output)s" ftype="tabular" /> |
275 <output name="html_file" file="%(test1HTML)s" ftype="html" lines_diff="10"/> | 282 <output name="html_file" file="%(test1HTML)s" ftype="html" lines_diff="10"/> |
276 </test></tests>""" | 283 </test></tests>""" |
277 xdict = {} | 284 xdict = {} |
285 xdict['requirements'] = '' | |
286 if self.opts.make_HTML: | |
287 xdict['requirements'] = protorequirements | |
278 xdict['tool_version'] = self.opts.tool_version | 288 xdict['tool_version'] = self.opts.tool_version |
279 xdict['test1Input'] = self.test1Input | 289 xdict['test1Input'] = self.test1Input |
280 xdict['test1HTML'] = self.test1HTML | 290 xdict['test1HTML'] = self.test1HTML |
281 xdict['test1Output'] = self.test1Output | 291 xdict['test1Output'] = self.test1Output |
282 if self.opts.make_HTML and self.opts.output_tab <> 'None': | 292 if self.opts.make_HTML and self.opts.output_tab <> 'None': |