Skip to content

CopyPathCommand

Sub classes

Name Children Inherits
UnixCopyPathCommand
anyenv.os_commands.copy_path
Unix/Linux copy path command implementation.
    MacOSCopyPathCommand
    anyenv.os_commands.copy_path
    macOS copy path command implementation.
      WindowsCopyPathCommand
      anyenv.os_commands.copy_path
      Windows copy path command implementation.

        Base classes

        Name Children Inherits
        ABC
        abc
        Helper class that provides a standard way to create an ABC using

        ⋔ Inheritance diagram

        graph TD
          2819545931["base.CopyPathCommand"]
          925645236["abc.ABC"]
          2751680898["builtins.object"]
          925645236 --> 2819545931
          2751680898 --> 925645236

        🛈 DocStrings

        Bases: ABC

        Base class for copy path commands.

        Source code in src/anyenv/os_commands/base.py
        class CopyPathCommand(ABC):
            """Base class for copy path commands."""
        
            @abstractmethod
            def create_command(self, source: str, destination: str, recursive: bool = False) -> str:
                """Generate copy command.
        
                Args:
                    source: Source path to copy from
                    destination: Destination path to copy to
                    recursive: Whether to copy directories recursively
                """
        
            @abstractmethod
            def parse_command(self, output: str, exit_code: int = 0) -> bool:
                """Parse copy result.
        
                Returns:
                    True if copy was successful, False otherwise
                """
        

        create_command abstractmethod

        create_command(source: str, destination: str, recursive: bool = False) -> str
        

        Generate copy command.

        Parameters:

        Name Type Description Default
        source str

        Source path to copy from

        required
        destination str

        Destination path to copy to

        required
        recursive bool

        Whether to copy directories recursively

        False
        Source code in src/anyenv/os_commands/base.py
        @abstractmethod
        def create_command(self, source: str, destination: str, recursive: bool = False) -> str:
            """Generate copy command.
        
            Args:
                source: Source path to copy from
                destination: Destination path to copy to
                recursive: Whether to copy directories recursively
            """
        

        parse_command abstractmethod

        parse_command(output: str, exit_code: int = 0) -> bool
        

        Parse copy result.

        Returns:

        Type Description
        bool

        True if copy was successful, False otherwise

        Source code in src/anyenv/os_commands/base.py
        @abstractmethod
        def parse_command(self, output: str, exit_code: int = 0) -> bool:
            """Parse copy result.
        
            Returns:
                True if copy was successful, False otherwise
            """
        

        :fa-brands-github: Show source on GitHub