-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
615 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,3 +72,5 @@ environment.yaml | |
.pixi | ||
dev.py | ||
store.sqlite | ||
**.kiarchive | ||
**.kontext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# Copyright (c) 2021, Markus Binsteiner | ||
# | ||
# Mozilla Public License, version 2.0 (see LICENSE or https://www.mozilla.org/en-US/MPL/2.0/) | ||
from typing import TYPE_CHECKING | ||
|
||
import rich_click as click | ||
|
||
from kiara.utils.cli import ( | ||
OutputFormat, | ||
output_format_option, | ||
terminal_print_model, | ||
) | ||
|
||
if TYPE_CHECKING: | ||
pass | ||
|
||
|
||
@click.group("archive") | ||
@click.pass_context | ||
def context(ctx): | ||
"""Kiara archive related sub-commands.""" | ||
|
||
|
||
@context.command("explain") | ||
@click.argument("archive", nargs=1, required=True) | ||
@output_format_option() | ||
@click.pass_context | ||
def explain_archive( | ||
ctx, | ||
format: str, | ||
archive: str, | ||
): | ||
"""Print details of an archive file.""" | ||
|
||
from kiara.api import KiaraAPI | ||
|
||
kiara_api: KiaraAPI = ctx.obj.kiara_api | ||
|
||
infos = kiara_api.get_archive_info(archive) | ||
|
||
if not format or format == OutputFormat.TERMINAL: | ||
for info in infos: | ||
types = ", ".join(info.archive_type_info.supported_item_types) | ||
terminal_print_model(info, in_panel=f"Archive type(s): {types}") | ||
else: | ||
terminal_print_model(*infos, format=format) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.