~wolterh/toolshed/trunk

« back to all changes in this revision

Viewing changes to shed/tool_template.py

  • Committer: Wolter Hellmund
  • Date: 2011-02-25 04:41:23 UTC
  • Revision ID: wolterh6@gmail.com-20110225044123-u1mgumcemogi6w09

RAMBLE: Well, its been a long time since the last commit was made. I am making new efforts to revive the application.
Changes:
 *This is a major overhaul to the application*
 * Command line input is now more neatly parsed, with the argparse library included in python.
 * Tools now do not require a python interface, just a plain text *.tool file with information about the tool. Specifically: name, version, application used to execute the tool, path to the tool, path to a help file.
 * Some other changes may exist

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# tool_template.py
2
 
 
3
 
# This is the template for tools
4
 
 
5
 
class Tool:
6
 
        # Class constructor
7
 
        def __init__(self, tool_name, help):
8
 
                self.name = tool_name
9
 
                self.help = help
10
 
                
11
 
        # Default action (run command)  
12
 
        def run (self, arguments = False):
13
 
                print 'The \'run\' function is the one called when you run \'toolshed <tool> [<arguments>]\'. Please customize it to fit your needs.'
14
 
        
15
 
help = \
16
 
'This is the help text. Customize it to fit your tool. If you have doubts about format, read the README file, or browse the code in existing tools.'
17
 
                
18
 
tool = Tool ('generic tool', help)
19
 
 
20