def splitFill(text, delim, count, fill=u""):
    """
    Split text by delim into up to count pieces. If less
    pieces than count+1 are available, additional pieces are added containing
    fill.
    """
    result = text.split(delim, count)
    if len(result) < count + 1:
        result += [fill] * (count + 1 - len(result))
    
    return result