Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename cli 'entries import' to 'entries add' #208

Merged
merged 2 commits into from
Aug 31, 2022
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: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export SEARCH_CONTEXT=es6_search_service
1. `poetry shell` and then:
2. `karp-cli entry-repo create karp/tests/data/config/places.json`
3. `karp-cli resource create karp/tests/data/config/places.json`
4. `karp-cli entries import places tests/data/places.jsonl`
4. `karp-cli entries add places tests/data/places.jsonl`
5. Do the same for `municipalities`
6. `karp-cli resource publish places`
7. `karp-cli resource publish municipalities`
Expand Down
8 changes: 4 additions & 4 deletions karp/cliapp/subapps/entries_subapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
subapp = typer.Typer()


@subapp.command("import")
@subapp.command("add")
@cli_error_handler
@cli_timer
def import_resource(
def add_entries_to_resource(
ctx: typer.Context,
resource_id: str,
# version: Optional[int],
Expand All @@ -44,7 +44,7 @@ def import_resource(
bus = inject_from_ctx(CommandBus, ctx)
user = user or "local admin"
message = message or "imported through cli"
entries = tqdm(json_streams.load_from_file(data), desc="Importing", unit=" entries")
entries = tqdm(json_streams.load_from_file(data), desc="Adding", unit=" entries")
if chunked:
cmd = lex.AddEntriesInChunks(
resource_id=resource_id,
Expand All @@ -61,7 +61,7 @@ def import_resource(
message=message,
)
bus.dispatch(cmd)
typer.echo(f"Successfully imported entries to {resource_id}")
typer.echo(f"Successfully added entries to {resource_id}")


@subapp.command("update")
Expand Down
Loading