Skip to content

Commit 707b508

Browse files
committed
documentation updates
1 parent 6f9da8d commit 707b508

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ of commands that we typically run to generate package artifacts (like migrations
2525
javascript). The deploy routine will be a collection of commands we typically run when deploying
2626
the site for the first time on a new server or when we deploy version updates on the server.
2727

28-
**Routines commands are run in the order they are registered, or by [priority](#priorities).**
28+
**Routine commands are run in the order they are registered, or by [priority](#priorities).**
2929

3030
In our settings file we may define these routines like this:
3131

django_routines/management/commands/routine.py

+24-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,16 @@ def {routine}(
4848

4949
class Command(TyperCommand, rich_markup_mode="rich"): # type: ignore
5050
"""
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.
5261
"""
5362

5463
help = _("Run batches of commands configured in settings.")
@@ -73,6 +82,10 @@ def routine(self, routine: t.Union[str, Routine]):
7382

7483
@property
7584
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+
"""
7689
assert self.routine
7790
return self.routine.plan(self.switches)
7891

@@ -85,6 +98,12 @@ def init(self, ctx: typer.Context, verbosity: Verbosity = verbosity):
8598
)
8699

87100
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+
"""
88107
assert self.routine
89108
for command in self.plan:
90109
if self.verbosity > 0:
@@ -115,6 +134,10 @@ def _run_routine(self):
115134
raise CommandError(f"Command not found: {command.command_name}")
116135

117136
def _list(self) -> None:
137+
"""
138+
List the commands that are part of the execution plan given the active
139+
routine and switches.
140+
"""
118141
for command in self.plan:
119142
priority = str(command.priority)
120143
cmd_str = command.command_str

doc/source/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ the site for the first time on a new server or when we deploy version updates on
1919

2020
.. note::
2121

22-
Routines commands are run in the order they are registered, or by priority_.
22+
Routine commands are run in the order they are registered, or by priority_.
2323

2424
.. literalinclude:: ../../examples/readme.py
2525
:caption: settings.py

0 commit comments

Comments
 (0)