json#

Defines a JSON reporter backend

This reporter backend is used to provide JSON strings for output rendering. It is essentially just a wrapper around conda.common.serialize.json_dump.

Classes#

JSONProgressBar

Progress bar that outputs JSON to stdout

JSONReporterRenderer

Default implementation for JSON reporting in conda

JSONSpinner

This class for a JSONSpinner does nothing because we do not want to include this output.

Functions#

conda_reporter_backends()

Reporter backend for JSON

class JSONProgressBar(description: str, enabled: bool = True, **kwargs)#

Bases: conda.plugins.types.ProgressBarBase

Progress bar that outputs JSON to stdout

update_to(fraction) None#
refresh()#
close()#
classmethod get_lock()#

Used for our own sys.stdout.write/flush calls

class JSONReporterRenderer#

Bases: conda.plugins.types.ReporterRendererBase

Default implementation for JSON reporting in conda

render(data: Any, **kwargs) str#
detail_view(data: dict[str, str | int | bool], **kwargs) str#

Render the output in a "tabular" format.

envs_list(data, **kwargs) str#

Render a list of environments

progress_bar(description: str, **kwargs) conda.plugins.types.ProgressBarBase#

Return a ProgressBarBase~ object to use as a progress bar

spinner(message: str, fail_message: str = 'failed\n') conda.plugins.types.SpinnerBase#

Return a SpinnerBase~ object to use as a spinner (i.e. loading dialog)

prompt(message: str = 'Proceed', choices=('yes', 'no'), default: str = 'yes') str#

For this class, we want this method to do nothing

class JSONSpinner(message: str, fail_message: str = 'failed\n')#

Bases: conda.plugins.types.SpinnerBase

This class for a JSONSpinner does nothing because we do not want to include this output.

__enter__()#
__exit__(exc_type, exc_val, exc_tb)#
conda_reporter_backends()#

Reporter backend for JSON

This is the default reporter backend that returns objects as JSON strings.