예제 #1
0
파일: property.py 프로젝트: Bandeira/sps
def __validate1(property):
    """ Exit with error if property is not valid.
    """
    msg = None

    if not property.feature().free():
        feature.validate_value_string(property.feature(), property.value())
예제 #2
0
def __validate1(property):
    """ Exit with error if property is not valid.
    """
    msg = None

    if not property.feature().free():
        feature.validate_value_string(property.feature(), property.value())
예제 #3
0
파일: property.py 프로젝트: malinost/boost
def __validate1 (property):
    """ Exit with error if property is not valid.
    """        
    msg = None

    f = get_grist (property)
    if f:
        value = get_value (property)

        if not feature.valid (f):
            f = ungrist (get_grist (property)) # Ungrist for better error messages
            msg = "Unknown feature '%s'" % f

        elif value and not 'free' in feature.attributes (f):
            feature.validate_value_string (f, value)

        elif not value:
            f = ungrist (get_grist (property)) # Ungrist for better error messages
            msg = "No value specified for feature '%s'" % f

    else:
        f = feature.implied_feature (property)
        feature.validate_value_string (f, property)

    if msg:
        # FIXME: don't use globals like this. Import here to
        # break circular dependency.
        from b2.manager import get_manager
        get_manager().errors()("Invalid property '%s': %s" % (property, msg))
예제 #4
0
def __validate1 (property):
    """ Exit with error if property is not valid.
    """
    assert isinstance(property, Property)
    msg = None

    if not property.feature.free:
        feature.validate_value_string (property.feature, property.value)
예제 #5
0
파일: property.py 프로젝트: timknab/Torsten
def __validate1(property):
    """ Exit with error if property is not valid.
    """
    assert isinstance(property, Property)
    msg = None

    if not property.feature.free:
        feature.validate_value_string(property.feature, property.value)