Returns an escape for a terminal text formatting type, or a list of types.

    Valid types are:
        * 'i' for 'italic'
        * 'b' for 'bold'
        * 'u' for 'underline'
        * 'r' for 'reverse'

def typeseq(types):
    """
    Returns an escape for a terminal text formatting type, or a list of types.

    Valid types are:
        * 'i' for 'italic'
        * 'b' for 'bold'
        * 'u' for 'underline'
        * 'r' for 'reverse'
    """
    ret = ""
    for t in types:
        ret += termcap.get(fmttypes[t])
    
    return ret