def fontWeightIndex(qFont, weights):
    """ Searches the index of qFont.family in the weight list.
        If qFont.weight() is not in the list, the index of QFont.Normal is returned.
        If that is also not present an error is raised.
    """
    try:
        return weights.index(qFont.weight())
    except ValueError:
        if False and DEBUGGING:
            raise
        else:
            logger.warn("{} not found in font weights, using normal.".format(qFont.weight()))
            return weights.index(QtGui.QFont.Normal)
Searches the index of qFont.family in the weight list.
        If qFont.weight() is not in the list, the index of QFont.Normal is returned.
        If that is also not present an error is raised.