def __init__(self, declaration, container_class): self._container_class = weakref.ref(container_class) self._contract = type_scheme.TypeScheme(declaration['Contract']) self._usage = declaration.get('Usage') or 'In' self._default = declaration.get('Default') self._has_default = 'Default' in declaration if self._usage not in PropertyUsages.All: raise exceptions.DslSyntaxError( 'Unknown type {0}. Must be one of ({1})'.format( self._usage, ', '.join(PropertyUsages.All)))
def __init__(self, declaration, namespace_resolver): self._namespace_resolver = namespace_resolver self._contract = type_scheme.TypeScheme(declaration['Contract']) self._default = declaration.get('Default') self._has_default = 'Default' in declaration self._usage = declaration.get('Usage') or 'In' if self._usage not in PropertyUsages.All: raise exceptions.DslSyntaxError( 'Unknown type {0}. Must be one of ({1})'.format( self._usage, ', '.join(PropertyUsages.All)))
def __init__(self, declaration, container_type): self._container_type = weakref.ref(container_type) self._contract = type_scheme.TypeScheme(declaration['Contract']) self._has_default = 'Default' in declaration self._default = declaration.get('Default')