def sortGlyphs(glyphlist):
    """
    Sort glyphs in a way that glyphs from the exceptionList, or glyphs starting
    with 'uni' names do not get to be key (first) glyphs.  An infinite loop is
    avoided, in case there are only glyphs matching above mentioned properties.
    """
    exceptionList = 'dotlessi dotlessj kgreenlandic ae oe AE OE uhorn'.split()

    glyphs = sorted(glyphlist)
    for i in range(len(glyphs)):
        if glyphs[0] in exceptionList or glyphs[0].startswith('uni'):
            glyphs.insert(len(glyphs), glyphs.pop(0))
        else:
            continue

    return glyphs