PyFunceble/helpers.py
def fix_path(self, splited_path=None):
        """
        Fix the path of the given path.

        :param splited_path: A list to convert to the right path.
        :type splited_path: list

        :return: The fixed path.
        :rtype: str
        """

        if not splited_path:
            # A splited path is parsed.

            # We initate a variable which will save the splited path.
            split_path = []

            if self.directory:
                # The parsed directory is not empty or equal to None.

                if "/" in self.directory:
                    # We split the separator.
                    split_path = self.directory.split("/")
                elif "\\" in self.directory:
                    # We split the separator.
                    split_path = self.directory.split("\\")
                else:
                    split_path = [self.directory]

                # We run the same function with the splited_path argument filled.
                return self.fix_path(splited_path=[x for x in split_path if x])

            # We return the directory.
            return self.directory

        # We join the splited element with the directory separator as glue.
        return directory_separator.join(splited_path) + directory_separator
def fix_path(self, splited_path=None):
        if not splited_path:
            # A splited path is parsed.

            # We initate a variable which will save the splited path.
            split_path = []

            if self.directory:
                # The parsed directory is not empty or equal to None.

                if "/" in self.directory:
                    # We split the separator.
                    split_path = self.directory.split("/")
                elif "\\" in self.directory:
                    # We split the separator.
                    split_path = self.directory.split("\\")
                else:
                    split_path = [self.directory]

                # We run the same function with the splited_path argument filled.
                return self.fix_path(splited_path=[x for x in split_path if x])

            # We return the directory.
            return self.directory

        # We join the splited element with the directory separator as glue.
        return directory_separator.join(splited_path) + directory_separator
def fix_path ( self , splited_path = None ) : if not splited_path : # A splited path is parsed. # We initate a variable which will save the splited path. split_path = [ ] if self . directory : # The parsed directory is not empty or equal to None. if "/" in self . directory : # We split the separator. split_path = self . directory . split ( "/" ) elif "\\" in self . directory : # We split the separator. split_path = self . directory . split ( "\\" ) else : split_path = [ self . directory ] # We run the same function with the splited_path argument filled. return self . fix_path ( splited_path = [ x for x in split_path if x ] ) # We return the directory. return self . directory # We join the splited element with the directory separator as glue. return directory_separator . join ( splited_path ) + directory_separator
Fix the path of the given path.

        :param splited_path: A list to convert to the right path.
        :type splited_path: list

        :return: The fixed path.
        :rtype: str
Fix the path of the given path .