示例#1
0
 def directory(self, value):
     """Normalize the value of :attr:`directory` when it's set."""
     # Normalize the value of `directory'.
     set_property(self, "directory", parse_path(value))
     # Clear the computed values of `context' and `entries'.
     clear_property(self, "context")
     clear_property(self, "entries")
示例#2
0
 def destination(self, value):
     """Automatically coerce strings to :class:`.Destination` objects."""
     if not isinstance(value, Destination):
         value = Destination(expression=value)
     set_property(self, 'destination', value)
     clear_property(self, 'destination_context')
示例#3
0
 def objects(self, value):
     """Set `objects` and clear `expression`."""
     set_property(self, 'objects', set(value))
     clear_property(self, 'id_or_expr')
     clear_property(self, 'expression')
示例#4
0
 def name(self, value):
     """Set `name` and `identifier`."""
     set_property(self, 'name', value)
     clear_property(self, 'id_or_expr')
     clear_property(self, 'identifier')
示例#5
0
 def expression(self, value):
     """Set `expression` and clear `objects`."""
     set_property(self, 'expression', value)
     clear_property(self, 'id_or_expr')
     clear_property(self, 'objects')