API Reference

Dish class

class dish.Dish

This is the main class. It holds configuration, extensions, and more. It works a bit similar to Flask’s Flask class.

Property current_repo

Holds the current Git repository, or None if you are not in a repository.

current_repo
config_from_dict(d)

This method adds the configuration values in a dictionary to the current configuration.

Parameters

d – A dictionary with configuration values.

generate_prompt(prompt_type)

Generates the prompt string.

Parameters

prompt_type – Can be either PS1 or PS2.

register_extension(module, **kwargs)

This initializes an extension module.

Parameters
  • module – A module with a register_extension function.

  • kwargs – Additional arguments to pass to the register_extension function of the module.

reset_config()

This resets the configuration to the default values.

run()

This method runs the shell. In your shell configuration script, this should be protected using an if __name__ == '__main__' condition.