rez.status#

class rez.status.Status#

Bases: object

Access to current status of the environment.

The current status tells you things such as if you are within a context, or if suite(s) are visible on $PATH.

__init__()#
context_file()#

Get path to the current context file.

Returns:

Str, or None if not in a context.

context()#

Get the current context.

Returns:

ResolvedContext or None if not in a context.

suites()#

Get currently visible suites.

Visible suites are those whos bin path appea on $PATH.

Returns:

List of Suite objects.

parent_suite()#

Get the current parent suite.

A parent suite exists when a context within a suite is active. That is, during execution of a tool within a suite, or after a user has entered an interactive shell in a suite context, for example via the command- line syntax ‘tool +i’, where ‘tool’ is an alias in a suite.

Returns:

Suite object, or None if there is no current parent suite.

active_suite_context_name()#

Get the name of the currently active context in a parent suite.

If a parent suite exists, then an active context exists - this is the context that a tool in the suite is currently running in.

Returns:

(str) Context name, or None if there is no parent suite (and thus no active context).

print_info(obj=None, buf=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)#

Print a status message about the given object.

If an object is not provided, status info is shown about the current environment - what the active context is if any, and what suites are visible.

Parameters:

obj (str) – String which may be one of the following: - A tool name; - A package name, possibly versioned; - A context filepath; - A suite filepath; - The name of a context in a visible suite.

print_tools(pattern=None, buf=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)#

Print a list of visible tools.

Parameters:

pattern (str) – Only list tools that match this glob pattern.