1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#! /usr/bin/env python
import sys
from doit.cmd_base import Command
from doit.doit_cmd import DoitMain
class MyCmd(Command):
doc_purpose = 'test extending doit commands'
doc_usage = '[XXX]'
doc_description = 'my command description'
def execute(self, opt_values, pos_args):
print "this command does nothing!"
class MyTool(DoitMain):
def get_commands(self):
cmds = DoitMain.get_commands(self)
my_cmd = MyCmd()
cmds[my_cmd.name] = my_cmd
return cmds
if __name__ == "__main__":
sys.exit(MyTool().run(sys.argv[1:]))
|