def clear_path_name(path):
    keepcharacters = (' ','.','_', '-')
    converted = "".join([c if (c.isalnum() or c in keepcharacters) else "_" for c in path]).rstrip()
    return converted

def shorten_name(name, offset = 50):
    if len(name) > offset:
        return name[:offset] + "..."
    else:
        return name