@@ -48,7 +48,16 @@ def {routine}(
48
48
49
49
class Command (TyperCommand , rich_markup_mode = "rich" ): # type: ignore
50
50
"""
51
- A TyperCommand_
51
+ A TyperCommand_ that reads the DJANGO_ROUTINES setting from settings and
52
+ builds out a set of subcommands for each routine that when invoked will run
53
+ those routines in order. Each routine also has a subcommand called ``list``
54
+ that prints which commands will be executed and in what order given the
55
+ switches the user has selected.
56
+
57
+ .. note::
58
+
59
+ If --verbosity is supplied, the value will be passed via options to any
60
+ command in the routine that accepts it.
52
61
"""
53
62
54
63
help = _ ("Run batches of commands configured in settings." )
@@ -73,6 +82,10 @@ def routine(self, routine: t.Union[str, Routine]):
73
82
74
83
@property
75
84
def plan (self ) -> t .List [RoutineCommand ]:
85
+ """
86
+ The RoutineCommands that make up the execution plan for the currently
87
+ active routine and switches.
88
+ """
76
89
assert self .routine
77
90
return self .routine .plan (self .switches )
78
91
@@ -85,6 +98,12 @@ def init(self, ctx: typer.Context, verbosity: Verbosity = verbosity):
85
98
)
86
99
87
100
def _run_routine (self ):
101
+ """
102
+ Execute the current routine plan. If verbosity is zero, do not print the
103
+ commands as they are run. Also use the stdout/stderr streams and color
104
+ configurion of the routine command for each of the commands in the execution
105
+ plan.
106
+ """
88
107
assert self .routine
89
108
for command in self .plan :
90
109
if self .verbosity > 0 :
@@ -115,6 +134,10 @@ def _run_routine(self):
115
134
raise CommandError (f"Command not found: { command .command_name } " )
116
135
117
136
def _list (self ) -> None :
137
+ """
138
+ List the commands that are part of the execution plan given the active
139
+ routine and switches.
140
+ """
118
141
for command in self .plan :
119
142
priority = str (command .priority )
120
143
cmd_str = command .command_str
0 commit comments