Commands Cache (xonsh.commands_cache)

class xonsh.commands_cache.CommandsCache[source]

A lazy cache representing the commands available on the file system. The keys are the command names and the values a tuple of (loc, has_alias) where loc is either a str pointing to the executable on the file system or None (if no executable exists) and has_alias is a boolean flag for whether the command has an alias.

get(k[, d]) → D[k] if k in D, else d. d defaults to None.
static get_possible_names(name)[source]

Generates the possible PATHEXT extension variants of a given executable name on Windows as a list, conserving the ordering in PATHEXT. Returns a list as name being the only item in it on other platforms.

is_empty()[source]

Returns whether the cache is populated or not.

items() → a set-like object providing a view on D's items
keys() → a set-like object providing a view on D's keys
lazy_locate_binary(name)[source]

Locates an executable in the cache, without checking its validity.

lazyget(key, default=None)[source]

A lazy value getter.

lazyin(key)[source]

Checks if the value is in the current cache without the potential to update the cache. It just says whether the value is known now. This may not reflect precisely what is on the $PATH.

lazyiter()[source]

Returns an iterator over the current cache contents without the potential to update the cache. This may not reflect what is on the $PATH.

lazylen()[source]

Returns the length of the current cache contents without the potential to update the cache. This may not reflect precisely what is on the $PATH.

locate_binary(name)[source]

Locates an executable on the file system using the cache.

values() → an object providing a view on D's values
all_commands