Skip to content

IsFileCommand

Sub classes

Name Children Inherits
UnixIsFileCommand
anyenv.os_commands.is_file
Unix/Linux is file command implementation.
    MacOSIsFileCommand
    anyenv.os_commands.is_file
    macOS is file command implementation.
      WindowsIsFileCommand
      anyenv.os_commands.is_file
      Windows is file 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
          153617120["base.IsFileCommand"]
          925645236["abc.ABC"]
          2751680898["builtins.object"]
          925645236 --> 153617120
          2751680898 --> 925645236

        🛈 DocStrings

        Bases: ABC

        Base class for is file commands.

        Source code in src/anyenv/os_commands/base.py
        class IsFileCommand(ABC):
            """Base class for is file commands."""
        
            @abstractmethod
            def create_command(self, path: str) -> str:
                """Generate file test command."""
        
            @abstractmethod
            def parse_command(self, output: str, exit_code: int = 0) -> bool:
                """Parse file test result."""
        

        create_command abstractmethod

        create_command(path: str) -> str
        

        Generate file test command.

        Source code in src/anyenv/os_commands/base.py
        @abstractmethod
        def create_command(self, path: str) -> str:
            """Generate file test command."""
        

        parse_command abstractmethod

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

        Parse file test result.

        Source code in src/anyenv/os_commands/base.py
        @abstractmethod
        def parse_command(self, output: str, exit_code: int = 0) -> bool:
            """Parse file test result."""
        

        :fa-brands-github: Show source on GitHub