diff options
| author | yo mama <pepper@scannerjammer.com> | 2015-10-10 02:54:41 -0700 |
|---|---|---|
| committer | yo mama <pepper@scannerjammer.com> | 2015-10-10 02:54:41 -0700 |
| commit | b02cc8d49513cdcc54f4421e71db3512354d4e2e (patch) | |
| tree | 2a3a83e1f99a1108eedb703d2cf8ed43613b2c22 /ricky/param/multiselect.py | |
| parent | 52d85ddcb9c934ec4dc0e890633762bfa2ff51f5 (diff) | |
renamed options to selections
Diffstat (limited to 'ricky/param/multiselect.py')
| -rw-r--r-- | ricky/param/multiselect.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ricky/param/multiselect.py b/ricky/param/multiselect.py index 68df161..21eca78 100644 --- a/ricky/param/multiselect.py +++ b/ricky/param/multiselect.py @@ -10,7 +10,7 @@ class MultiSelect(Param): return super(MultiSelect, self).value_get() def value_set(self, value): - if not any([value == i['value'] for i in self._options]) and \ + if not any([value == i['value'] for i in self._selections]) and \ value is not None: raise ValueError super(MultiSelect, self).value_set(value) @@ -18,10 +18,10 @@ class MultiSelect(Param): value = property(value_get, value_set) def randomize(self): - weights_total = sum(map(lambda x: x["weight"], self.options())) + weights_total = sum(map(lambda x: x["weight"], self.selections())) choice = random.randint(0, weights_total) position = 0 - for elem in self.options(): + for elem in self.selections(): position += elem["weight"] if position >= choice: self.value = elem["value"] |
