def renames(from_path, to_path, user=None):
    """
    Rename ``from_path`` to ``to_path``, creating parents as needed.
    """
    to_dir = path.dirname(to_path)
    if to_dir:
        mkdir(to_dir, user=user)
    rename(from_path, to_path, user=user)
def renames ( from_path , to_path , user = None ) : to_dir = path . dirname ( to_path ) if to_dir : mkdir ( to_dir , user = user ) rename ( from_path , to_path , user = user )
Rename ``from_path`` to ``to_path``, creating parents as needed.