System

class lib.system.system.System

Bases: object

Holds information about the currently running system and environment

Attributes Summary

is_linux

True if running on a Linux system otherwise False.

is_macos

True if running on a macOS system otherwise False.

is_windows

True if running on a Windows system otherwise False.

Methods Summary

validate()

Perform validation that the running system can be used for faceswap.

validate_python([max_version])

Check that the running Python version is valid

Attributes Documentation

is_linux

True if running on a Linux system otherwise False.

is_macos

True if running on a macOS system otherwise False.

is_windows

True if running on a Windows system otherwise False.

Methods Documentation

validate() None

Perform validation that the running system can be used for faceswap. Log an error and exit if it cannot

Return type:

None

validate_python(max_version: tuple[int, int] | None = None) bool

Check that the running Python version is valid

Parameters:

max_version (tuple[int, int] | None) – The max version to validate Python against. None for the project Maximum. Default: None (project maximum)

Return type:

True if the running Python version is valid, otherwise logs an error and exits

cpu_count

The number of CPU cores on the system

encoding

The system encoding

is_admin

True if we are running with Admin privileges

is_conda

True if running under Conda otherwise False

property is_linux: bool

True if running on a Linux system otherwise False.

property is_macos: bool

True if running on a macOS system otherwise False.

is_virtual_env

True if Python is being run inside a virtual environment

property is_windows: bool

True if running on a Windows system otherwise False.

machine

“x86_64”)

Type:

The machine type (eg

platform

Human readable platform identifier

processor

The processor in use, if detected

python_architecture

64bit/32bit)

Type:

The Python architecture that is running (eg

python_implementation

The python implementation in use

python_version

The <major>.<minor>.<release> version of Python that is running

release

The OS Release that this code is running on

system: Literal['darwin', 'linux', 'windows']

The system (OS type) that this code is running on. Always lowercase

validate() None

Perform validation that the running system can be used for faceswap. Log an error and exit if it cannot

Return type:

None

validate_python(max_version: tuple[int, int] | None = None) bool

Check that the running Python version is valid

Parameters:

max_version (tuple[int, int] | None) – The max version to validate Python against. None for the project Maximum. Default: None (project maximum)

Return type:

True if the running Python version is valid, otherwise logs an error and exits