Replaces the suffix of name by new_suffix.
        If no suffix exists, the new one is added.

def replace_suffix (name, new_suffix):
    """ Replaces the suffix of name by new_suffix.
        If no suffix exists, the new one is added.
    """
    assert isinstance(name, basestring)
    assert isinstance(new_suffix, basestring)
    split = os.path.splitext (name)
    return split [0] + new_suffix