maestral.cli.core

This module provides custom click command line parameters for Maestral such DropboxPath, ConfigKey and ConfigName, as well as an ordered command group class which prints its help output in sections.

Module Contents

class maestral.cli.core.DropboxPath(file_okay=True, dir_okay=True)[source]

Bases: click.ParamType

A command line parameter representing a Dropbox path

This parameter type provides custom shell completion for items inside the local Dropbox folder.

Parameters
  • file_okay (bool) – Controls if a file is a possible value.

  • dir_okay (bool) – Controls if a directory is a possible value.

name = Dropbox path[source]
envvar_list_splitter[source]
convert(self, value, param, ctx)[source]
Parameters
Return type

str | None

shell_complete(self, ctx, param, incomplete)[source]
Parameters
Return type

list[click.shell_completion.CompletionItem]

class maestral.cli.core.ConfigKey[source]

Bases: click.ParamType

A command line parameter representing a config key

This parameter type provides custom shell completion for existing config keys.

name = key[source]
shell_complete(self, ctx, param, incomplete)[source]
Parameters
Return type

list[click.shell_completion.CompletionItem]

class maestral.cli.core.ConfigName(existing=True)[source]

Bases: click.ParamType

A command line parameter representing a Dropbox path

This parameter type provides custom shell completion for existing config names.

Parameters

existing (bool) – If True require an existing config, otherwise create a new config on demand.

name = config[source]
convert(self, value, param, ctx)[source]
Parameters
Return type

str | None

shell_complete(self, ctx, param, incomplete)[source]
Parameters
Return type

list[click.shell_completion.CompletionItem]

class maestral.cli.core.OrderedGroup[source]

Bases: click.Group

Click command group with customizable sections of help output.

sections :dict[str, list[tuple[str, click.Command]]][source]
add_command(self, cmd, name=None, section='')[source]
Parameters
Return type

None

format_commands(self, ctx, formatter)[source]
Parameters
Return type

None

class maestral.cli.core.CliException[source]

Bases: click.ClickException

Subclass of click.CliException exception with a nicely formatted error message.

show(self, file=None)[source]
Parameters

file (IO | None) –

Return type

None