| 1 |
from doit.cmd_base import Command |
| 2 |
|
| 3 |
class MyCmd(Command): |
| 4 |
name = 'mycmd' |
| 5 |
doc_purpose = 'test extending doit commands' |
| 6 |
doc_usage = '[XXX]' |
| 7 |
doc_description = 'my command description' |
| 8 |
|
| 9 |
def execute(self, opt_values, pos_args): |
| 10 |
print("this command does nothing!") |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
from doit.task import dict_to_task |
| 16 |
from doit.cmd_base import TaskLoader2 |
| 17 |
|
| 18 |
my_builtin_task = { |
| 19 |
'name': 'sample_task', |
| 20 |
'actions': ['echo hello from built in'], |
| 21 |
'doc': 'sample doc', |
| 22 |
} |
| 23 |
|
| 24 |
class MyLoader(TaskLoader2): |
| 25 |
|
| 26 |
def load_doit_config(self): |
| 27 |
return {'verbosity': 2} |
| 28 |
|
| 29 |
def load_tasks(self, cmd, pos_args): |
| 30 |
return [dict_to_task(my_builtin_task)] |
| 31 |
|