summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpepperpepperpepper <pepper@scannerjammer.com>2015-12-05 17:23:14 -0800
committerpepperpepperpepper <pepper@scannerjammer.com>2015-12-05 17:23:14 -0800
commitdac73bd39db07e2fc471fb306f62d48d9a7faf9e (patch)
tree784f52e7be7428f3d8c42a0cfafc7d4afe3b414d
parente85b0885ac45e5773a2e9dfb2b91bc8a57de98e2 (diff)
updated imbreak
-rwxr-xr-xexample.py10
-rw-r--r--ricky/imbreak/params.py1
-rw-r--r--ricky/param/enum.py2
-rw-r--r--ricky/param/imageurl.py6
4 files changed, 12 insertions, 7 deletions
diff --git a/example.py b/example.py
index e1773dd..ee4228d 100755
--- a/example.py
+++ b/example.py
@@ -1,14 +1,16 @@
#!/usr/bin/python2.7
from ricky.imgradient import ImGradient
+from ricky.imbreak import ImBreak
-api = ImGradient()
+api = ImBreak()
params = api.params_init()
print params
params.randomize()
-print params['color1']
-params['color1'].from_normalized(0.28187431585)
-print params['color1']
+print params
+#print params['color1']
+#params['color1'].from_normalized(0.28187431585)
+#print params['color1']
# print params.as_dict()
# req = params.execute()
# print req
diff --git a/ricky/imbreak/params.py b/ricky/imbreak/params.py
index 9ceb89c..90ad41d 100644
--- a/ricky/imbreak/params.py
+++ b/ricky/imbreak/params.py
@@ -47,6 +47,7 @@ class ImBreakParams(Params):
ConstrainedNumber(
name="breakangle",
required=False,
+ enforce_int=True,
min=-180,
max=180),
Enum(
diff --git a/ricky/param/enum.py b/ricky/param/enum.py
index 3a9fe0e..d4a839a 100644
--- a/ricky/param/enum.py
+++ b/ricky/param/enum.py
@@ -5,7 +5,7 @@ import decimal
class Enum(Param):
def __init__(self, options=None, **kwargs):
- self._options = set(options)
+ self._options = tuple(options)
if not self._options:
raise ValueError("Object must be initialized with options set")
super(Enum, self).__init__(**kwargs)
diff --git a/ricky/param/imageurl.py b/ricky/param/imageurl.py
index 8c26e8f..8b4aff4 100644
--- a/ricky/param/imageurl.py
+++ b/ricky/param/imageurl.py
@@ -1,7 +1,9 @@
from ricky.config import TEST_URL
from ricky.param.string import String
+
class ImageUrl(String):
def __init__(self, *args, **kwargs):
- super(ImageUrl, self).__init__(*args, **kwargs)
- self.default(TEST_URL)
+ if 'default' not in kwargs:
+ kwargs['default'] = TEST_URL
+ super(ImageUrl, self).__init__(*args, **kwargs)