(self, path)
return keys
Takes a path and returns a simple absolute path as a list of directories from the root
Takes a path and returns a simple absolute path as a list of directories from the root
Takes a path and returns a simple absolute path as a list of directories from the root
def _normalize_path(self, path):
        """
        Takes a path and returns a simple absolute path as a list of directories from the root
        """
        if type(path) is str:
            path = path.encode()
        path = path.split(b'\0')[0]

        if path[0:1] != self.pathsep:
            path = self.cwd + self.pathsep + path
        keys = path.split(self.pathsep)
        i = 0
        while i < len(keys):
            if keys[i] == b'':
                keys.pop(i)
            elif keys[i] == b'.':
                keys.pop(i)
            elif keys[i] == b'..':
                keys.pop(i)
                if i != 0:
                    keys.pop(i-1)
                    i -= 1
            else:
                i += 1
        return keys
def _normalize_path ( self , path ) : if type ( path ) is str : path = path . encode ( ) path = path . split ( b'\0' ) [ 0 ] if path [ 0 : 1 ] != self . pathsep : path = self . cwd + self . pathsep + path keys = path . split ( self . pathsep ) i = 0 while i < len ( keys ) : if keys [ i ] == b'' : keys . pop ( i ) elif keys [ i ] == b'.' : keys . pop ( i ) elif keys [ i ] == b'..' : keys . pop ( i ) if i != 0 : keys . pop ( i - 1 ) i -= 1 else : i += 1 return keys