Utils Module

Utils for input types

author:

Doug Skrypa

class cli_command_parser.inputs.utils.InputParam(default: Any)[source]

Bases: object

default
name
class cli_command_parser.inputs.utils.StatMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: FixedFlag

DIR = 1
FILE = 2
CHARACTER = 4
BLOCK = 8
FIFO = 16
SOCKET = 64
ANY = 127
matches(mode: int) bool[source]
class cli_command_parser.inputs.utils.FileWrapper(path: Path, mode: str = 'r', encoding: str = None, errors: str = None, converter: Converter = None, pass_file: Bool = False, parents: Bool = False)[source]

Bases: object

read() Any[source]
write(data: Any)[source]
close()[source]
cli_command_parser.inputs.utils.allows_write(mode: str, strict: bool = False) bool[source]
cli_command_parser.inputs.utils.fix_windows_path(path: Path) Path[source]

Attempts to resolve issues related to inconsistencies between the way the version of Bash that is distributed with Git handles paths in some situations and the way that Python handles paths.

The use case that this function currently handles is when the given Path does not exist, and it was auto-completed by Git Bash to begin with /{drive}/... instead of {drive}:/....