ExecutionEnvironment

from acron.core import ExecutionEnvironment
class ExecutionEnvironment

Bases:

Encapsulates access to the environment variables and command-line arguments at the time of execution. This is encapsulated to support accessing these things during static init time, which seems to be risky at best.

Inheritance diagram

digraph inheritancea2c554bb94 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "ExecutionEnvironment" [URL="acron.core.ExecutionEnvironment.html#acron.core.ExecutionEnvironment",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ExecutionEnvironment" [arrowsize=0.75,style=""]; }
__init__()

You shouldn’t need to construct one of these; there’s only one and it constructs itself.

property args → Sequence[string]

Returns the nth command-line argument. The index n must be in the range [0 .. get_num_args()). The first parameter, n == 0, is the first actual parameter, not the binary name.

property binary_name → string
Getter

Returns the name of the binary executable that started this program, if it can be determined.

Setter

Do not use.

static clear_shadow()

Removes a value set by a previous call to shadow_environment_variable(), and lets the actual value of the variable show again.

property cwd → Filename

Returns the name of the current working directory.

property dtool_name → string
Getter

Returns the name of the libdtool DLL that is used in this program, if it can be determined.

Setter

Do not use.

property environment_variables → string
Getter

Returns the definition of the indicated environment variable, or the empty string if the variable is undefined.

Setter

Changes the definition of the indicated environment variable.

static expand_string()

Reads the string, looking for environment variable names marked by a $. Expands all such variable names. A repeated dollar sign ($$) is mapped to a single dollar sign.

Returns the expanded string.

static get_arg()

Returns the nth command-line argument. The index n must be in the range [0 .. get_num_args()). The first parameter, n == 0, is the first actual parameter, not the binary name.

static get_binary_name()

Returns the name of the binary executable that started this program, if it can be determined.

static get_cwd()

Returns the name of the current working directory.

static get_dtool_name()

Returns the name of the libdtool DLL that is used in this program, if it can be determined.

static get_environment_variable()

Returns the definition of the indicated environment variable, or the empty string if the variable is undefined.

static get_num_args()

Returns the number of command-line arguments available, not counting arg 0, the binary name.

static has_environment_variable()

Returns true if the indicated environment variable is defined.

static set_binary_name()

Do not use.

static set_dtool_name()

Do not use.

static set_environment_variable()

Changes the definition of the indicated environment variable.

static shadow_environment_variable()

Changes the apparent definition of the indicated environment variable by masking it within this class with a new value. This does not change the actual environment variable, but future calls to get_environment_variable() will return this new value.