import string


def format_polyinfo(polyinfo_output, flt=True):
    """Formats string output from cmds.polyInfo to usable data"""
    out = []
    for s in polyinfo_output:
        ascii_filtered = "".join([i for i in s if i not in string.ascii_letters])
        formatted = ascii_filtered.split(":")[1].split(" ")
        empty_strings_filtered = filter(None, formatted)
        newline_filtered = [i for i in empty_strings_filtered if i != u"\n"]
        converted = [float(i) if flt else int(i) for i in newline_filtered]
        out.append(converted)
    if len(out) > 1:
        return out
    return out[0]