plain 0.48.0__py3-none-any.whl → 0.49.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
plain/cli/README.md CHANGED
@@ -30,6 +30,12 @@ Run a Python script in the context of your app.
30
30
 
31
31
  View the runtime value of a named setting.
32
32
 
33
+ ### `plain help`
34
+
35
+ Print help for all available commands and subcommands.
36
+ Each command's help output is prefixed with the full command name for
37
+ readability.
38
+
33
39
  ### `plain shell`
34
40
 
35
41
  Open a Python shell with the Plain loaded.
plain/cli/core.py CHANGED
@@ -10,6 +10,7 @@ from .build import build
10
10
  from .chores import chores
11
11
  from .docs import docs
12
12
  from .formatting import PlainContext
13
+ from .help import help_cmd
13
14
  from .preflight import preflight_checks
14
15
  from .registry import cli_registry
15
16
  from .scaffold import create
@@ -34,6 +35,7 @@ plain_cli.add_command(urls)
34
35
  plain_cli.add_command(setting)
35
36
  plain_cli.add_command(shell)
36
37
  plain_cli.add_command(run)
38
+ plain_cli.add_command(help_cmd)
37
39
 
38
40
 
39
41
  class CLIRegistryGroup(click.Group):
plain/cli/help.py ADDED
@@ -0,0 +1,27 @@
1
+ import click
2
+ from click.core import MultiCommand
3
+
4
+
5
+ @click.command("help")
6
+ @click.pass_context
7
+ def help_cmd(ctx):
8
+ """Show help for all commands and subcommands."""
9
+
10
+ root = ctx.parent.command
11
+ info_name = ctx.parent.info_name or "plain"
12
+
13
+ def print_help(cmd, prog, parent=None):
14
+ sub_ctx = click.Context(cmd, info_name=prog, parent=parent)
15
+
16
+ title = sub_ctx.command_path
17
+ click.secho(title, fg="green", bold=True)
18
+ click.secho("-" * len(title), fg="green")
19
+ click.echo(sub_ctx.get_help())
20
+
21
+ if isinstance(cmd, MultiCommand):
22
+ for name in cmd.list_commands(sub_ctx):
23
+ click.echo()
24
+ sub_cmd = cmd.get_command(sub_ctx, name)
25
+ print_help(sub_cmd, name, sub_ctx)
26
+
27
+ print_help(root, info_name)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain
3
- Version: 0.48.0
3
+ Version: 0.49.0
4
4
  Summary: A web framework for building products with Python.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-File: LICENSE
@@ -17,13 +17,14 @@ plain/assets/views.py,sha256=T_0Qh6v9qBerEBYbhToigwOzsij-x1z_R-1zETQcIh0,9447
17
17
  plain/chores/README.md,sha256=Da8Nw8ZF7PlAE_iVb0AqJGbLOu0F6HC0cj1K451KBak,1946
18
18
  plain/chores/__init__.py,sha256=r9TXtQCH-VbvfnIJ5F8FxgQC35GRWFOfmMZN3q9niLg,67
19
19
  plain/chores/registry.py,sha256=V3WjuekRI22LFvJbqSkUXQtiOtuE2ZK8gKV1TRvxRUI,1866
20
- plain/cli/README.md,sha256=ompPcgzY2Fdpm579ITmCpFIaZIsiXYbfD61mqkq312M,1860
20
+ plain/cli/README.md,sha256=nkcpS_mWPZ6JbnlKh4fq-b7AlmItAQsT78XAqRlwqNg,2017
21
21
  plain/cli/__init__.py,sha256=6w9T7K2WrPwh6DcaMb2oNt_CWU6Bc57nUTO2Bt1p38Y,63
22
22
  plain/cli/build.py,sha256=dKUYBNegvb6QNckR7XZ7CJJtINwZcmDvbUdv2dWwjf8,3226
23
23
  plain/cli/chores.py,sha256=xXSSFvr8T5jWfLWqe6E8YVMw1BkQxyOHHVuY0x9RH0A,2412
24
- plain/cli/core.py,sha256=sy5otyN5jNOHkcy1EXISB7iMr1itp0rzmBSnEXYGe2k,2866
24
+ plain/cli/core.py,sha256=h8gjeBYQzYTzpmeDMAJTdVDOEoNCNcvnxml-KIsiRPo,2925
25
25
  plain/cli/docs.py,sha256=2CpTv5k-TNWf593tPiglvUVXWBGdfPmbGf8vl5AfJwU,8995
26
26
  plain/cli/formatting.py,sha256=1hZH13y1qwHcU2K2_Na388nw9uvoeQH8LrWL-O9h8Yc,2207
27
+ plain/cli/help.py,sha256=otRSGxOJ5V8JMjpdZ8XYqUbdlYdJvxOMzQroLOWw-l0,801
27
28
  plain/cli/preflight.py,sha256=NKyYjcoDjigzfJIDhf7A7degYadaUI05Bw7U9OQ73vs,4170
28
29
  plain/cli/print.py,sha256=XraUYrgODOJquIiEv78wSCYGRBplHXtXSS9QtFG5hqY,217
29
30
  plain/cli/registry.py,sha256=yKVMSDjW8g10nlV9sPXFGJQmhC_U-k4J4kM7N2OQVLA,1467
@@ -145,8 +146,8 @@ plain/views/forms.py,sha256=ESZOXuo6IeYixp1RZvPb94KplkowRiwO2eGJCM6zJI0,2400
145
146
  plain/views/objects.py,sha256=GGbcfg_9fPZ-PiaBwIHG2e__8GfWDR7JQtQ15wTyiHg,5970
146
147
  plain/views/redirect.py,sha256=daq2cQIkdDF78bt43sjuZxRAyJm_t_SKw6tyPmiXPIc,1985
147
148
  plain/views/templates.py,sha256=ivkI7LU7BXDQ0d4Geab96Is4-Cp03KbIntXRT1J8e6I,2139
148
- plain-0.48.0.dist-info/METADATA,sha256=N4Mvv-2mriZwcXfYBEWMz88pp3Sc4oik88GXI4akoMk,4297
149
- plain-0.48.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
150
- plain-0.48.0.dist-info/entry_points.txt,sha256=1Ys2lsSeMepD1vz8RSrJopna0RQfUd951vYvCRsvl6A,45
151
- plain-0.48.0.dist-info/licenses/LICENSE,sha256=m0D5O7QoH9l5Vz_rrX_9r-C8d9UNr_ciK6Qwac7o6yo,3175
152
- plain-0.48.0.dist-info/RECORD,,
149
+ plain-0.49.0.dist-info/METADATA,sha256=h5KgVsVtWFjd4CveudNI0w7_TsFeroqviAiWssBGNwE,4297
150
+ plain-0.49.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
151
+ plain-0.49.0.dist-info/entry_points.txt,sha256=1Ys2lsSeMepD1vz8RSrJopna0RQfUd951vYvCRsvl6A,45
152
+ plain-0.49.0.dist-info/licenses/LICENSE,sha256=m0D5O7QoH9l5Vz_rrX_9r-C8d9UNr_ciK6Qwac7o6yo,3175
153
+ plain-0.49.0.dist-info/RECORD,,
File without changes