File: sample_plugin.py

package info (click to toggle)
doit 0.36.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,704 kB
  • sloc: python: 11,863; makefile: 33; ansic: 14; javascript: 3; sh: 1
file content (31 lines) | stat: -rw-r--r-- 705 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
30
31
from doit.cmd_base import Command

class MyCmd(Command):
    name = 'mycmd'
    doc_purpose = 'test extending doit commands'
    doc_usage = '[XXX]'
    doc_description = 'my command description'

    def execute(self, opt_values, pos_args): # pragma: no cover
        print("this command does nothing!")


##############

from doit.task import dict_to_task
from doit.cmd_base import TaskLoader2

my_builtin_task = {
    'name': 'sample_task',
    'actions': ['echo hello from built in'],
    'doc': 'sample doc',
    }

class MyLoader(TaskLoader2):

    def load_doit_config(self):
        return {'verbosity': 2}

    def load_tasks(self, cmd, pos_args):
        return [dict_to_task(my_builtin_task)]