pynenc.cli.main_cli

Module Contents

Functions

_set_auto_discovered_app_label

_try_find_monitor_app

Try monitor auto-discovery without failing the command when no local app exists.

_resolve_app_for_command

Attach app instance to args when the selected command requires one.

main

Execute the Pynenc Command Line Interface.

API

pynenc.cli.main_cli._set_auto_discovered_app_label(args: pynenc.cli.namespace.PynencCLINamespace, app_instance: pynenc.app.Pynenc) None[source]
pynenc.cli.main_cli._try_find_monitor_app() Pynenc | None[source]

Try monitor auto-discovery without failing the command when no local app exists.

pynenc.cli.main_cli._resolve_app_for_command(args: pynenc.cli.namespace.PynencCLINamespace) None[source]

Attach app instance to args when the selected command requires one.

pynenc.cli.main_cli.main() None[source]

Execute the Pynenc Command Line Interface.

This function initializes and processes the command line arguments for the Pynenc application, sets up logging, and executes the appropriate subcommand function based on the user input.

The CLI supports various subcommands for different functionalities, such as running tasks and configuring the application. The --app parameter is optional when the current directory contains exactly one importable Pynenc() instance; use it explicitly when more than one app exists or when running outside the app directory.

The main steps include:

  • Parsing command line arguments with argparse.

  • Setting up logging based on verbosity.

  • Importing the application instance.

  • Executing the function associated with the chosen subcommand.

Exceptions:

  • Various exceptions can be raised depending on the subcommands executed and the application’s behavior.