def adjust_prefix(name_prefix):
    """Adds a delimiter if the prefix is not empty."""

    if name_prefix is None or len(name_prefix) == 0:
        name_prefix = ""
    else:
        if name_prefix[-1] != ".":
            name_prefix = name_prefix + "."

    return name_prefix