summaryrefslogtreecommitdiff
path: root/ricky/param/multiselect.py
diff options
context:
space:
mode:
Diffstat (limited to 'ricky/param/multiselect.py')
-rw-r--r--ricky/param/multiselect.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/ricky/param/multiselect.py b/ricky/param/multiselect.py
deleted file mode 100644
index 8da5374..0000000
--- a/ricky/param/multiselect.py
+++ /dev/null
@@ -1,32 +0,0 @@
-import random
-from ricky.param import Param
-
-
-class MultiSelect(Param):
- def __init__(self, **kwargs):
- super(MultiSelect, self).__init__(**kwargs)
- self._options = kwargs.get('options') or []
- if len(self._options):
- self._validate_options()
-
- def options(self):
- return self._options
-
- def _validate_options(self):
- try:
- pass
- except Exception:
- raise ValueError('Unable to validate %s\n:' % self.name)
-
- def value_get(self):
- return super(MultiSelect, self).value_get()
-
- def value_set(self, value):
- if value not in self._options and value is not None:
- raise ValueError
- super(MultiSelect, self).value_set(value)
-
- value = property(value_get, value_set)
-
- def randomize(self):
- self.value_set(random.choice(self.options))