mirror of
https://git.yoctoproject.org/poky
synced 2026-05-08 17:19:20 +00:00
spdx: Add set helper for list properties
This adds the set helper for list properties to allow list members to be replaced with a new list. This is necessary as it is (currently) the only way to replace the default value for a list member. (From OE-Core rev: 8280b857c510646cd10167dd2ea9a0c2d5f1e800) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
555f9166bf
commit
d366a1a223
+4
-1
@@ -105,10 +105,13 @@ class _ListProperty(_Property):
|
||||
obj._spdx[name] = []
|
||||
return obj._spdx[name]
|
||||
|
||||
def set_helper(obj, value):
|
||||
obj._spdx[name] = list(value)
|
||||
|
||||
def del_helper(obj):
|
||||
del obj._spdx[name]
|
||||
|
||||
attrs[name] = property(get_helper, None, del_helper)
|
||||
attrs[name] = property(get_helper, set_helper, del_helper)
|
||||
|
||||
def init(self, source):
|
||||
return [self.prop.init(o) for o in source]
|
||||
|
||||
Reference in New Issue
Block a user