def _cleanpath(self, path):
        """
        Clean up path - remove repeated and trailing separators. 
        """
        
        slashes = self.remotepathsep*2
        while slashes in path:
            path = path.replace(slashes,self.remotepathsep)
            
        if path.endswith(self.remotepathsep):
            path = path[:-1]
            
        return path

        Clean up path - remove repeated and trailing separators. 
        
recipes/Python/275594_Recursive_nlst_wFTP_Directory_Tree/recipe-275594.py