Add __setitem__ to ValueList
This commit is contained in:
parent
1a20bbe7d0
commit
21e628a1ba
@ -157,6 +157,17 @@ class ValueList:
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
return self.default[key]
|
return self.default[key]
|
||||||
|
|
||||||
|
def __setitem__(self, key, value):
|
||||||
|
"""Set the value for key.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
key: The key to set the value for, as a string.
|
||||||
|
value: The value to set, as a string
|
||||||
|
|
||||||
|
"""
|
||||||
|
valtype = self.types[1]
|
||||||
|
self.values[key] = conftypes.SettingValue(valtype, value)
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
"""Iterate over all set values."""
|
"""Iterate over all set values."""
|
||||||
# FIXME using a custon iterator this could be done more efficiently
|
# FIXME using a custon iterator this could be done more efficiently
|
||||||
|
Loading…
Reference in New Issue
Block a user