find_work.cli.options#

Command line options implemented as a single object.

class find_work.cli.options.OptionsBase(*, children: dict[str, OptionsBase] = None)#

Bases: BaseModel, ABC

Base class for all option objects.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

children: dict[str, OptionsBase]#

Subcommand options.

abstract property attr_order: Sequence[str]#

Sequence of attributes, in order they’ll appear in breadcrumbs.

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_fields: ClassVar[Dict[str, FieldInfo]] = {'children': FieldInfo(annotation=dict[str, OptionsBase], required=False, default_factory=dict)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

class find_work.cli.options.MainOptions(*, children: dict[str, OptionsBase] = None, colors: bool | None = None, verbose: bool = True, breadcrumbs: Breadcrumbs = None, maintainer: str = '', only_installed: bool = False)#

Bases: OptionsBase

Main application options.

colors: bool | None#

Enable/disable colors.

verbose: bool#

Enable/disable progress reporting.

breadcrumbs: Breadcrumbs#

Unique predictable identificator that can be used as a cache key.

maintainer: str#

Display only packages for given maintainer email.

only_installed: bool#

Display installed packages only.

override(opt_module: str, opt_name: str, value: Any) None#

Override an option in one of the children.

Parameters:
  • opt_module – “path” to the OptionsBase object

  • opt_name – target option name

  • value – new value

static echo(message: Any | None = None, **kwargs: Any) None#

Simple alias to click.echo().

vecho(message: Any | None = None, **kwargs: Any) None#

Alias to click.echo() but with our verbosity settings.

secho(message: Any | None = None, **kwargs: Any) None#

Alias to click.secho() but with our color settings.

exit(result: Result) None#

Display a result message.

Parameters:

result – result message

property attr_order: Sequence[str]#

Sequence of attributes, in order they’ll appear in breadcrumbs.

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'breadcrumbs': FieldInfo(annotation=Breadcrumbs, required=False, default_factory=Breadcrumbs), 'children': FieldInfo(annotation=dict[str, OptionsBase], required=False, default_factory=dict), 'colors': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None), 'maintainer': FieldInfo(annotation=str, required=False, default=''), 'only_installed': FieldInfo(annotation=bool, required=False, default=False), 'verbose': FieldInfo(annotation=bool, required=False, default=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.