Skip to content

ProcessEnvironment

Qt Base Class: QProcessEnvironment

Signature: QProcessEnvironment(self) -> None QProcessEnvironment(self, arg__1: PySide6.QtCore.QProcessEnvironment.Initialization) -> None QProcessEnvironment(self, other: Union[PySide6.QtCore.QProcessEnvironment, PySide6.QtCore.QProcessEnvironment.Initialization]) -> None

Base classes

Name Children Inherits
QProcessEnvironment
PySide6.QtCore
QProcessEnvironment(self) -> None
MutableMapping
collections.abc
A MutableMapping is a generic container for associating

⋔ Inheritance diagram

graph TD
  1473299800384["core.ProcessEnvironment"]
  1473243773488["QtCore.QProcessEnvironment"]
  1473291690208["Shiboken.Object"]
  140713234304496["builtins.object"]
  1473222543776["abc.MutableMapping"]
  1473222540848["abc.Mapping"]
  1473222211728["abc.Collection"]
  1473222226368["abc.Sized"]
  1473222223440["abc.Iterable"]
  1473222220512["abc.Container"]
  1473243773488 --> 1473299800384
  1473291690208 --> 1473243773488
  140713234304496 --> 1473291690208
  1473222543776 --> 1473299800384
  1473222540848 --> 1473222543776
  1473222211728 --> 1473222540848
  1473222226368 --> 1473222211728
  140713234304496 --> 1473222226368
  1473222223440 --> 1473222211728
  140713234304496 --> 1473222223440
  1473222220512 --> 1473222211728
  140713234304496 --> 1473222220512

🛈 DocStrings

Bases: QProcessEnvironment, MutableMapping

Holds the environment variables that can be passed to a program.

Source code in prettyqt\core\processenvironment.py
class ProcessEnvironment(
    QtCore.QProcessEnvironment, MutableMapping, metaclass=datatypes.QABCMeta
):
    """Holds the environment variables that can be passed to a program."""

    def __bool__(self):
        return not self.isEmpty()

    def __contains__(self, other: str):
        return self.contains(other)

    def __getitem__(self, index: str) -> str:
        if index not in self:
            raise KeyError("Environment variable not set.")
        return self.value(index)

    def __delitem__(self, index: str):
        self.remove(index)

    def __setitem__(self, index: str, value: str):
        return self.insert(index, value)

    def __iter__(self) -> Iterator[str]:
        return iter(self.keys())

    def __len__(self):
        return len(self.keys())

    @classmethod
    def get_system_environment(cls) -> Self:
        return cls(cls.systemEnvironment())