providers
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| MacOSCommandProvider anyenv.os_commands.providers macOS command provider using BSD tools. |
||
| OSCommandProvider anyenv.os_commands.providers Base class for OS-specific command providers using command classes. |
||
| UnixCommandProvider anyenv.os_commands.providers Unix/Linux command provider using GNU/POSIX tools. |
||
| WindowsCommandProvider anyenv.os_commands.providers Windows command provider using PowerShell and CMD. |
🛈 DocStrings¶
OS-specific command providers using the command classes.
MacOSCommandProvider
¶
Bases: OSCommandProvider
macOS command provider using BSD tools.
Source code in src/anyenv/os_commands/providers.py
__init__
¶
Initialize macOS command provider with macOS command instances.
Source code in src/anyenv/os_commands/providers.py
OSCommandProvider
¶
Base class for OS-specific command providers using command classes.
Source code in src/anyenv/os_commands/providers.py
__init__
¶
Initialize the command provider with command instances.
Source code in src/anyenv/os_commands/providers.py
get_command
¶
get_command(command_type: Literal['list_directory']) -> ListDirectoryCommand
get_command(command_type: Literal['file_info']) -> FileInfoCommand
get_command(command_type: Literal['exists']) -> ExistsCommand
get_command(command_type: Literal['is_file']) -> IsFileCommand
get_command(command_type: Literal['is_directory']) -> IsDirectoryCommand
get_command(command_type: Literal['create_directory']) -> CreateDirectoryCommand
get_command(command_type: Literal['remove_path']) -> RemovePathCommand
get_command(command_type: Literal['copy_path']) -> CopyPathCommand
get_command(command_type: Literal['base64_encode']) -> Base64EncodeCommand
get_command(command_type: Literal['which']) -> WhichCommand
get_command(command_type: Literal['pwd']) -> PwdCommand
get_command(command_type: Literal['env_var']) -> EnvVarCommand
get_command(command_type: Literal['find']) -> FindCommand
get_command(
command_type: CommandType,
) -> (
ListDirectoryCommand
| FileInfoCommand
| ExistsCommand
| IsFileCommand
| IsDirectoryCommand
| CreateDirectoryCommand
| RemovePathCommand
| CopyPathCommand
| Base64EncodeCommand
| WhichCommand
| PwdCommand
| EnvVarCommand
| FindCommand
)
Get command instance by type.
Source code in src/anyenv/os_commands/providers.py
UnixCommandProvider
¶
Bases: OSCommandProvider
Unix/Linux command provider using GNU/POSIX tools.
Source code in src/anyenv/os_commands/providers.py
__init__
¶
Initialize Unix command provider with Unix command instances.
Source code in src/anyenv/os_commands/providers.py
WindowsCommandProvider
¶
Bases: OSCommandProvider
Windows command provider using PowerShell and CMD.
Source code in src/anyenv/os_commands/providers.py
__init__
¶
Initialize Windows command provider with Windows command instances.
Source code in src/anyenv/os_commands/providers.py
get_os_command_provider
¶
get_os_command_provider(
system: Literal["Windows", "Darwin", "Linux"] | None = None,
) -> OSCommandProvider
Auto-detect OS and return appropriate command provider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
Literal['Windows', 'Darwin', 'Linux'] | None
|
The system to use. If None, the current system is used. |
None
|
Returns:
| Type | Description |
|---|---|
OSCommandProvider
|
OS-specific command provider based on current platform |