CliOptions

class lib.gui.options.CliOptions

Bases: object

Class and methods for the command line options

Attributes Summary

categories

tuple[str, str] The categories for faceswap's GUI

commands

dict[str, ]

opts

dict[str, dict[str, CliOption | str]] The command line options collected from faceswap's cli files

Methods Summary

clear([command])

Clear the options values for all or passed commands

gen_cli_arguments(command)

Yield the generated cli arguments for the selected command

get_one_option_variable(command, title)

Return a single tkinter.Variable tk_var for the specified command and control_title

get_option_values([command])

Return all or single command control titles with the associated tk_var value

reset([command])

Reset the options for all or passed command back to default value

Attributes Documentation

categories

tuple[str, str] The categories for faceswap’s GUI

commands

dict[str, ]

opts

dict[str, dict[str, CliOption | str]] The command line options collected from faceswap’s cli files

Methods Documentation

clear(command: str | None = None) None

Clear the options values for all or passed commands

Parameters:

command (str | None, optional) – The command to clear the options for. None to clear options for all commands. Default: None

Return type:

None

gen_cli_arguments(command: str) Generator[tuple[str, ...], None, None]

Yield the generated cli arguments for the selected command

Parameters:

command (str) – The command to generate the command line arguments for

Yields:

tuple[str, …] – The generated command line arguments

Return type:

Generator[tuple[str, …], None, None]

get_one_option_variable(command: str, title: str) Variable | None

Return a single tkinter.Variable tk_var for the specified command and control_title

Parameters:
  • command (str) – The command to return the variable from

  • title (str) – The option title to return the variable for

Returns:

The requested tkinter variable, or None if it could not be found

Return type:

tkinter.Variable | None

get_option_values(command: str | None = None) dict[str, dict[str, bool | int | float | str]]

Return all or single command control titles with the associated tk_var value

Parameters:

command (str | None, optional) – The command to get the option values for. None to get all option values. Default: None

Returns:

option values in the format {command: {option_name: option_value}}

Return type:

dict[str, dict[str, bool | int | float | str]]

reset(command: str | None = None) None

Reset the options for all or passed command back to default value

Parameters:

command (str | None, optional) – The command to reset the options for. None to reset for all commands. Default: None

Return type:

None

property categories: tuple[Literal['faceswap', 'tools'], ...]

tuple[str, str] The categories for faceswap’s GUI

clear(command: str | None = None) None

Clear the options values for all or passed commands

Parameters:

command (str | None, optional) – The command to clear the options for. None to clear options for all commands. Default: None

Return type:

None

property commands: dict[Literal['faceswap', 'tools'], list[str]]

dict[str, ]

gen_cli_arguments(command: str) Generator[tuple[str, ...], None, None]

Yield the generated cli arguments for the selected command

Parameters:

command (str) – The command to generate the command line arguments for

Yields:

tuple[str, …] – The generated command line arguments

Return type:

Generator[tuple[str, …], None, None]

get_one_option_variable(command: str, title: str) Variable | None

Return a single tkinter.Variable tk_var for the specified command and control_title

Parameters:
  • command (str) – The command to return the variable from

  • title (str) – The option title to return the variable for

Returns:

The requested tkinter variable, or None if it could not be found

Return type:

tkinter.Variable | None

get_option_values(command: str | None = None) dict[str, dict[str, bool | int | float | str]]

Return all or single command control titles with the associated tk_var value

Parameters:

command (str | None, optional) – The command to get the option values for. None to get all option values. Default: None

Returns:

option values in the format {command: {option_name: option_value}}

Return type:

dict[str, dict[str, bool | int | float | str]]

property opts: dict[str, dict[str, CliOption | str]]

dict[str, dict[str, CliOption | str]] The command line options collected from faceswap’s cli files

reset(command: str | None = None) None

Reset the options for all or passed command back to default value

Parameters:

command (str | None, optional) – The command to reset the options for. None to reset for all commands. Default: None

Return type:

None