chore: Logo parameter in docling CLI, prints cute ascii logo (#1294)
logo parameter in docling cli, prints cute ascii logo Signed-off-by: Maksym Lysak <mly@zurich.ibm.com> Co-authored-by: Maksym Lysak <mly@zurich.ibm.com>
This commit is contained in:
parent
14e9c0ce9a
commit
355d8dc7a6
@ -60,6 +60,44 @@ err_console = Console(stderr=True)
|
||||
ocr_factory_internal = get_ocr_factory(allow_external_plugins=False)
|
||||
ocr_engines_enum_internal = ocr_factory_internal.get_enum()
|
||||
|
||||
DOCLING_ASCII_ART = r"""
|
||||
████ ██████
|
||||
███░░██░░░░░██████
|
||||
████████░░░░░░░░████████████
|
||||
████████░░░░░░░░░░░░░░░░░░████████
|
||||
██████░░░░░░░░░░░░░░░░░░░░░░░░░░██████
|
||||
██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████
|
||||
██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████
|
||||
██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████
|
||||
██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████
|
||||
██████░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░██████
|
||||
██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████
|
||||
██████░░░░░░ ░░░░░░░░░░░░░░░ ░░░░░░██████
|
||||
███▒██░░░░░ ████ ░░░░░░░░░░░░ ████ ░░░░░██▒███
|
||||
███▒██░░░░░░ ████ ░░░░░░░░░░░░ ████ ░░░░░██▒████
|
||||
███▒██░░░░░░ ██ ██ ░░░░░░░░░░░░ ██ ██ ░░░░░██▒▒███
|
||||
███▒███░░░░░ ██ ░░░░████░░░░ ██ ░░░░░██▒▒███
|
||||
████▒▒██░░░░░░ ░░░███▒▒▒▒███░░░ ░░░░░░░██▒▒████
|
||||
████▒▒██░░░░░░░░░░░░░░░░░█▒▒▒▒▒▒▒▒▒▒█░░░░░░░░░░░░░░░░███▒▒████
|
||||
████▒▒▒██░░░░░░░░░░░░█████ ▒▒▒▒▒▒ ██████░░░░░░░░░░░██▒▒▒████
|
||||
███▒▒▒▒██░░░░░░░░███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒███░░░░░░░░██▒▒▒▒███
|
||||
███▒▒▒▒▒███░░░░░░██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██░░░░░░███▒▒▒▒▒███
|
||||
████▒▒▒▒▒████░░░░░░██████████████████████░░░░░░████▒▒▒▒▒████
|
||||
███▒▒▒▒▒▒▒▒████░░░░░░░░░░░░░░░░░░░░░░░░░░░████▒▒▒▒▒▒▒▒▒███
|
||||
████▒▒▒▒▒▒▒▒███░░░░░████████████████████████▒▒▒▒▒▒▒▒▒████
|
||||
████▒▒▒▒▒▒██░░░░░░█ █░░░░░██▒▒▒▒▒▒████
|
||||
████▒▒▒▒█░░░░░░░█ D O C L I N G █░░░░░░░░██▒▒▒████
|
||||
████▒▒██░░░░░░█ █░░░░░░░░░░█▒▒████
|
||||
██████░░░░░░█ D O C L I N G █░░░░░░░░░░░██████
|
||||
████░░░░░█ █░░░░░░░░░░░░████
|
||||
█████░░█ D O C L I N G █░░░░░░░░░░░█████
|
||||
█████ █░░░░░░░░████████
|
||||
██ D O C L I N G █░░░░░░░░█████
|
||||
█ █░░░████████
|
||||
█████████████████████████████
|
||||
"""
|
||||
|
||||
|
||||
app = typer.Typer(
|
||||
name="Docling",
|
||||
no_args_is_help=True,
|
||||
@ -68,6 +106,12 @@ app = typer.Typer(
|
||||
)
|
||||
|
||||
|
||||
def logo_callback(value: bool):
|
||||
if value:
|
||||
print(DOCLING_ASCII_ART)
|
||||
raise typer.Exit()
|
||||
|
||||
|
||||
def version_callback(value: bool):
|
||||
if value:
|
||||
docling_version = importlib.metadata.version("docling")
|
||||
@ -356,6 +400,12 @@ def convert(
|
||||
device: Annotated[
|
||||
AcceleratorDevice, typer.Option(..., help="Accelerator device")
|
||||
] = AcceleratorDevice.AUTO,
|
||||
docling_logo: Annotated[
|
||||
Optional[bool],
|
||||
typer.Option(
|
||||
"--logo", callback=logo_callback, is_eager=True, help="Docling logo"
|
||||
),
|
||||
] = None,
|
||||
):
|
||||
if verbose == 0:
|
||||
logging.basicConfig(level=logging.WARNING)
|
||||
|
Loading…
Reference in New Issue
Block a user