Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES/+move_generic.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The module `generic` moved from `pulpcore.cli.common.generic` to `pulp_cli.generic`.
The old import path is still available for compatibility reasons.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ docs:
pulp-docs build

servedocs:
pulp-docs serve -w CHANGES.md -w pulp-glue/pulp_glue -w pulpcore/cli/common/generic.py
pulp-docs serve -w CHANGES.md -w pulp-glue/pulp_glue -w pulp_cli/generic.py

pulp-glue/pulp_glue/%/locale/messages.pot: pulp-glue/pulp_glue/%/*.py
xgettext -d $* -o $@ pulp-glue/pulp_glue/$*/*.py
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import typing as t

import click
from pulp_cli.generic import pulp_group
from pulp_glue.common.i18n import get_translation
from pulpcore.cli.common.generic import pulp_group

# TODO Implement these
# from pulpcore.cli.{{ cookiecutter.app_label }}.content import content
Expand Down
2 changes: 1 addition & 1 deletion cookiecutter/ci/{{ cookiecutter.__project_name }}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ docs:
pulp-docs build

servedocs:
pulp-docs serve -w CHANGES.md -w pulp-glue/pulp_glue -w pulpcore/cli/common/generic.py
pulp-docs serve -w CHANGES.md -w pulp-glue/pulp_glue -w pulp_cli/generic.py
{%- endif %}
{%- if cookiecutter.translations %}
{%- if cookiecutter.glue %}
Expand Down
14 changes: 7 additions & 7 deletions docs/dev/learn/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ A plugin must register itself with the main app by specifying its main module as
The plugin should then attach subcommands to the `pulpcore.cli.common.main` command by providing a `mount` method in the main module.

```python
from pulpcore.cli.common.generic import pulp_command
from pulp_cli.generic import pulp_command

@pulp_command()
def my_command():
Expand All @@ -52,7 +52,7 @@ def mount(main: click.Group, **kwargs: Any) -> None:
## Contexts

In `click`, every subcommand is accompanied by a `click.Context`, and objects can be attached to them.
In this CLI we attach a [`PulpCLIContext`][pulpcore.cli.common.generic.PulpCLIContext] to the main command, which inherits from `pulp-glue`'s [`PulpContext`][pulp_glue.common.context.PulpContext].
In this CLI we attach a [`PulpCLIContext`][pulp_cli.generic.PulpCLIContext] to the main command, which inherits from `pulp-glue`'s [`PulpContext`][pulp_glue.common.context.PulpContext].
This context handles the communication to the pulp server through its `api` property.

Further we encourage the handling of communication with certain endpoints by subclassing the [`PulpEntityContext`][pulp_glue.common.context.PulpEntityContext] or some of the resource-specific children, such as [PulpRepositoryContext][pulp_glue.common.context.PulpRepositoryContext].
Expand Down Expand Up @@ -80,20 +80,20 @@ def my_sub_command(entity_ctx):

For certain often repeated patterns like listing all entities of a particular kind,
we provide generic commands that use the underlying context objects.
The following example shows the use of the [`show_command`][pulpcore.cli.common.generic.show_command] generic.
The following example shows the use of the [`show_command`][pulp_cli.generic.show_command] generic.

```python
from pulpcore.cli.common.generic import name_option, show_command,
from pulp_cli.generic import name_option, show_command,

lookup_params = [name_option]
my_command.add_command(show_command(decorators=lookup_params))
```

To add options to these subcommands, pass a list of [`PulpOption`][pulpcore.cli.common.generic.PulpOption] objects to the `decorators` argument.
Preferably these are created using the [`pulp_option`][pulpcore.cli.common.generic.pulp_option] factory.
To add options to these subcommands, pass a list of [`PulpOption`][pulp_cli.generic.PulpOption] objects to the `decorators` argument.
Preferably these are created using the [`pulp_option`][pulp_cli.generic.pulp_option] factory.

```python
from pulpcore.cli.common.generic import list_command,
from pulp_cli.generic import list_command,

filter_params = [
pulp_option("--name"),
Expand Down
3 changes: 0 additions & 3 deletions docs/dev/reference/common_generic.md

This file was deleted.

3 changes: 3 additions & 0 deletions docs/dev/reference/generic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# pulp\_cli.generic

::: pulp_cli.generic
Loading
Loading