File: custom_cmd.py

package info (click to toggle)
doit 0.25.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,404 kB
  • ctags: 1,504
  • sloc: python: 11,084; makefile: 111; ansic: 14
file content (29 lines) | stat: -rw-r--r-- 587 bytes parent folder | download
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:]))