def get_normalized_path(path):
    """
    Normalizes a path, escaping slashes if needed on Windows.

    Usage::

        >>> get_normalized_path("C:\\Users/johnDoe\\Documents")
        u'C:\\Users\\JohnDoe\\Documents'

    :param path: Path to normalize.
    :type path: unicode
    :return: Normalized path.
    :rtype: unicode
    """

    if platform.system() == "Windows" or platform.system() == "Microsoft":
        path = os.path.normpath(path).replace("\\", "\\\\")
        LOGGER.debug("> Path: '{0}', normalized path.".format(path))
        return path
    else:
        path = os.path.normpath(path)
        LOGGER.debug("> Path: '{0}', normalized path.".format(path))
        return path
def get_normalized_path ( path ) : if platform . system ( ) == "Windows" or platform . system ( ) == "Microsoft" : path = os . path . normpath ( path ) . replace ( "\\" , "\\\\" ) LOGGER . debug ( "> Path: '{0}', normalized path." . format ( path ) ) return path else : path = os . path . normpath ( path ) LOGGER . debug ( "> Path: '{0}', normalized path." . format ( path ) ) return path
Normalizes a path, escaping slashes if needed on Windows.

    Usage::

        >>> get_normalized_path("C:\\Users/johnDoe\\Documents")
        u'C:\\Users\\JohnDoe\\Documents'

    :param path: Path to normalize.
    :type path: unicode
    :return: Normalized path.
    :rtype: unicode