From 107b40de0a2a7bcb6abcebb9aabd0f5bb7dabb4b Mon Sep 17 00:00:00 2001 From: yo mama Date: Fri, 6 Mar 2015 00:52:17 -0800 Subject: option --- Pb_Api/Param/Options.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Pb_Api/Param/Options.py (limited to 'Pb_Api/Param/Options.py') diff --git a/Pb_Api/Param/Options.py b/Pb_Api/Param/Options.py new file mode 100644 index 0000000..d19f42a --- /dev/null +++ b/Pb_Api/Param/Options.py @@ -0,0 +1,13 @@ +class Pb_Api_Param_Options: + def __init__(self, arr): + self._values = arr + def __iter__(self): + return iter(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 -- cgit v1.2.3-70-g09d2