summaryrefslogtreecommitdiff
path: root/ricky/param/options.py
diff options
context:
space:
mode:
authorpepperpepperpepper <pepper@scannerjammer.com>2015-09-30 00:56:49 -0700
committerpepperpepperpepper <pepper@scannerjammer.com>2015-09-30 00:56:49 -0700
commit5521785e6c52dd4603699d057d62a5797844fd13 (patch)
tree3516ba416147ebd00104f3f5fc666371432af0ae /ricky/param/options.py
parent20a896ed6a8d54c3e59baa33ce3fce7a26343c20 (diff)
huge rename
Diffstat (limited to 'ricky/param/options.py')
-rw-r--r--ricky/param/options.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/ricky/param/options.py b/ricky/param/options.py
new file mode 100644
index 0000000..2a21cce
--- /dev/null
+++ b/ricky/param/options.py
@@ -0,0 +1,21 @@
+from ricky.param.option import Option
+import sys
+class Options:
+ def __init__(self, *args):
+ self._values = args
+ def __iter__(self):
+ return iter(self._values)
+ def __len__(self):
+ return len(self._values)
+ def __str__(self):
+ return str(self._values)
+ def __getitem__(self, i):
+ return self._values[i]
+ def search(self, s):
+ for i in self:
+ if str(s) in i.value:
+ return i
+ @classmethod
+ def from_dict(cls, *args):
+ options = map(lambda x: Option(**x), args);
+ return cls(*options);