bundle.core.platform¶
Attributes¶
Classes¶
Represents a single platform-specific shell command and its result. |
|
Represents a collection of platform-specific commands to be executed. |
|
Abstract base class for platform-specific data models. |
|
Data model for macOS (Darwin) platform-specific information. |
|
Represents the current platform's system and Python environment information. |
Module Contents¶
- class bundle.core.platform.ProcessCommand(/, **data: Any)[source]¶
Bases:
bundle.core.data.DataRepresents a single platform-specific shell command and its result.
- async run()[source]¶
Execute the shell command asynchronously and store its output in result.
- Returns:
None
- Raises:
ProcessError – If the command execution fails.
- class bundle.core.platform.ProcessCommands(/, **data: Any)[source]¶
Bases:
bundle.core.data.DataRepresents a collection of platform-specific commands to be executed.
- commands¶
List of ProcessCommand instances.
- Type:
- commands: list[ProcessCommand] = None¶
- async run() ProcessCommands[source]¶
Execute all contained platform commands asynchronously.
- Returns:
The instance with updated results for each command.
- Return type:
- class bundle.core.platform.PlatformSpecific(/, **data: Any)[source]¶
Bases:
bundle.core.data.DataAbstract base class for platform-specific data models.
- classmethod platform_commands() ProcessCommands[source]¶
- Abstractmethod:
Return a ProcessCommands instance with platform-specific commands.
- Returns:
The commands to be executed for this platform.
- Return type:
- Raises:
NotImplementedError – If not implemented by a subclass.
- classmethod resolve() PlatformSpecific[source]¶
Resolve and instantiate the platform-specific data model by running its commands.
- Returns:
An instance populated with command results.
- Return type:
- class bundle.core.platform.Darwin(/, **data: Any)[source]¶
Bases:
PlatformSpecificData model for macOS (Darwin) platform-specific information.
- class bundle.core.platform.Platform(/, **data: Any)[source]¶
Bases:
bundle.core.entity.EntityRepresents the current platform’s system and Python environment information.
- cwd¶
The current working directory.
- Type:
Path
- home¶
The user’s home directory.
- Type:
Path
- cwd: pathlib.Path = None¶
- home: pathlib.Path = None¶
- property platform_string: str¶
Return a string summarizing the platform and Python environment.
- Returns:
A string in the format “{system}-{machine}-{python_implementation}{python_version}”.
- Return type:
- property is_windows: bool¶
Check if the current system is Windows.
- Returns:
True if Windows, False otherwise.
- Return type:
- bundle.core.platform.platform_info¶