Variables

class getmac.variables.Variables[source]

Bases: VarsClass

Things that can change.

Essentially most of the global variables in getmac.

Attributes Summary

CHECK_COMMAND_CACHE

Cache of commands that have been checked for existence by check_command().

DEFAULT_IFACE

Name of the local host's default network interface.

ENV

Use a copy of the environment so any modifications that need to be made for operation of getmac doesn't modify the process's current environment.

PATH

Get and cache the configured system PATH environment variable on import.

PATH_STR

The PATH as a string.

log

Global logger for getmac.

Attributes Documentation

CHECK_COMMAND_CACHE: Dict[str, bool] = {}

Cache of commands that have been checked for existence by check_command(). This speeds up subsequent lookups of the same command. The key is the command name, and the value is a boolean indicating if it exists.

DEFAULT_IFACE: str = ''

Name of the local host’s default network interface.

ENV: Dict[str, str]

Use a copy of the environment so any modifications that need to be made for operation of getmac doesn’t modify the process’s current environment.

PATH: List[str]

Get and cache the configured system PATH environment variable on import. The process environment does not change after a process is started.

PATH_STR: str

The PATH as a string. Used for lookups by getmac.utils.check_command(), which uses shutil.which() under the hood.

log: Logger

Global logger for getmac. The logger name is getmac.