Mixin class providing system-level operations for the Object class in Objects.py.
ObjSystem encapsulates methods related to operating system interaction, environment detection, singleton process locking, IP address resolution, and in-memory database connections. It is mixed into Object via Python MRO and requires no __init__.
| Method | Description |
|---|---|
system_run(command) |
Execute a local shell command via subprocess.Popen and return output |
is_docker() |
Detect if running inside a Docker container via DOCKER_AXION env var |
is_pytest() |
Check if running under a pytest session |
get_virtualization_environment() |
Detect virtualization: lxc, kvm, vmware, aws, wsl, virtualbox, physical, or unknown |
get_ip_address(host) |
Resolve the local machine IP address (cached) |
single_instance(flavor_id) |
Acquire a file-based singleton lock to prevent duplicate processes |
unlock_instance() |
Release the singleton lock file (registered with atexit) |
get_local_folder() |
Return the working directory or frozen executable path |
connect_mem_db() |
Create and return an in-memory SQLite connection |
This class has no __init__ and no base class. All self.* references (e.g. self.debug(), self.DB, self.CheckedIp) are resolved at runtime through the MRO chain when mixed into Object.
from Objects import Object
obj = Object()
obj.system_run("ls -la")
obj.is_docker()
obj.get_virtualization_environment()