def stringToBool( string ):
    """
    Converts a string with the contents 'true' or 'false' to the
    appropriate boolean value.

    Examples:

    >>> stringToBool( 'true' )
    True

    >>> stringToBool( 'false' )
    False

    >>> stringToBool( 'True' )
    Traceback (most recent call last):
    ...
    ValueError: can't convert to boolean: True
    """

    if string == "true":
        return True
    elif string == "false":
        return False
    else:
        raise ValueError( "can't convert to boolean: %s" % string )