Inheritance diagram for IPython.core.prompts:
Classes for handling input/output prompts.
Authors:
Bases: IPython.config.configurable.Configurable
This is the primary interface for producing IPython’s prompts.
Get the config class config section
Get the help string for this class in ReST format.
If inst is given, it’s current trait values will be used in place of class defaults.
Get the help string for a single trait.
If inst is given, it’s current trait values will be used in place of the class default.
Get the help string for a single trait and print it.
Get a list of all the names of this classes traits.
This method is just like the trait_names() method, but is unbound.
Get a list of all the traits of this class.
This method is just like the traits() method, but is unbound.
The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.
This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.
A trait for unicode strings.
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
A trait for unicode strings.
A trait for unicode strings.
An instance of a Python dict.
A boolean (True, False) trait.
An instance of a Python dict.
Setup a handler to be called when a trait changes.
This is used to setup dynamic notifications of trait changes.
Static handlers can be created by creating methods on a HasTraits subclass with the naming convention ‘_[traitname]_changed’. Thus, to create static handler for the trait ‘a’, create the method _a_changed(self, name, old, new) (fewer arguments can be used, see below).
Parameters : | handler : callable
name : list, str, None
remove : bool
|
---|
A trait for unicode strings.
Render the selected prompt.
Parameters : | name : str
color : bool
just : bool
**kwargs : :
|
---|---|
Returns : | A string containing the rendered prompt. : |
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
An instance of a Python dict.
Get metadata values for trait by key.
Get a list of all the names of this classes traits.
Get a list of all the traits of this class.
The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.
This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.
An int trait.
Fire the traits events when the config is updated.
This is called when a prompt template is updated. It processes abbreviations used in the prompt template (like #) and calculates how many invisible characters (ANSI colour escapes) the resulting prompt contains.
It is also called for each prompt on changing the colour scheme. In both cases, traitlets should take care of calling this automatically.
An int trait.
Bases: string.Formatter
A Formatter that falls back on a shell’s user_ns and __builtins__ for name resolution
Return the last depth elements of the current working directory.
$HOME is always replaced with ‘~’. If depth==0, the full path is returned.
Return the last depth elements of the current working directory.
$HOME is always replaced with ‘~’. If depth==0, the full path is returned.
Replace in ‘text’ all occurences of any key in the given dictionary by its corresponding value. Returns the new string.