How to use the wslpy.convert.PathConvType.WINDOUBLE function in wslpy

To help you get started, we’ve selected a few wslpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wslutilities / wslpy / wslpy / convert.py View on Github external
elif toType == PathConvType.WIN:
            return __Lin2Win__(input)
        elif toType == PathConvType.LINUX:
            return input
        elif toType == PathConvType.WINDOUBLE:
            return __Win2Dwin__(__Lin2Win__(input))
        else:
            raise ValueError("ERROR: Invalid Conversion Type "+toType)
    elif re.match(r'[A-Za-z]:\\\\', input) is not None:  # Windows Path /w Double Dashline
        if toType == PathConvType.AUTO:
            return __DWin2Lin__(input)
        elif toType == PathConvType.LINUX:
            return __DWin2Lin__(input)
        elif toType == PathConvType.WIN:
            return __Lin2Win__(__DWin2Lin__(input))
        elif toType == PathConvType.WINDOUBLE:
            return input
        else:
            raise ValueError("ERROR: Invalid Conversion Type "+toType)
    elif re.match(r'[A-Za-z]:', input) is not None:  # Windows Path
        if toType == PathConvType.AUTO:
            return __DWin2Lin__(__Win2Dwin__(input))
        elif toType == PathConvType.LINUX:
            return __DWin2Lin__(__Win2Dwin__(input))
        elif toType == PathConvType.WIN:
            return input
        elif toType == PathConvType.WINDOUBLE:
            return __Win2Dwin__(input)
        else:
            raise ValueError("Invalid Conversion Type "+toType)
    else:
        raise ValueError("Invalid Path "+input)
github wslutilities / wslpy / wslpy / convert.py View on Github external
Parameters
    ----------
    input : str
        the string of the original path.

    Returns
    -------
    string of Windows Path /w Double Style path.

    Raises
    ------
    ValueError
        An error occurred when the input is invalid.
    """
    return to(input, PathConvType.WINDOUBLE)

wslpy

Python Library for WSL specific tasks

GPL-3.0
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis