summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpepperpepperpepper <pepper@scannerjammer.com>2015-10-04 17:35:12 -0700
committerpepperpepperpepper <pepper@scannerjammer.com>2015-10-04 17:35:12 -0700
commit69845d6d9594db1b1ed22a47c2042c48ef98b495 (patch)
treed472a96b890aec5c438a0752eeba8d2bab59002e
parent4f08494370d226b168f485253db2d87ef2da4222 (diff)
made some small fixes
-rwxr-xr-xexample.py28
-rw-r--r--ricky/config.py2
-rw-r--r--ricky/im.py2
-rw-r--r--ricky/imbreak/imbreak.py2
-rw-r--r--ricky/imgradient/imgradient.py2
-rw-r--r--ricky/imgrid/imgrid.py2
-rwxr-xr-xricky/impattern/impattern.py2
-rw-r--r--ricky/impattern/params.py2
-rw-r--r--ricky/params.py2
9 files changed, 22 insertions, 22 deletions
diff --git a/example.py b/example.py
index 4fd6965..58e4d9f 100755
--- a/example.py
+++ b/example.py
@@ -6,17 +6,17 @@ from ricky.imbreak import ImBreak
from ricky.imgradient import ImGradient
import pprint
-#api = ImPattern()
-#params = api.params_init()
-#params.randomize()
-#print params.as_hash()
-#req = params.execute()
-#print req
+api = ImPattern()
+params = api.params_init()
+params.randomize()
+print params.as_dict()
+req = params.execute()
+print req
#api = ImGrid()
#params = api.params_init()
#params.randomize()
-#print params.as_hash()
+#print params.as_dict()
#req = params.execute()
#print req
@@ -25,13 +25,13 @@ import pprint
#api = ImBreak()
#params = api.params_init()
#params.randomize()
-#print params.as_hash()
+#print params.as_dict()
#req = params.execute()
#print req
-api = ImGradient()
-params = api.params_init()
-params.randomize()
-print params.as_hash()
-req = params.execute()
-print req
+#api = ImGradient()
+#params = api.params_init()
+#params.randomize()
+#print params.as_dict()
+#req = params.execute()
+#print req
diff --git a/ricky/config.py b/ricky/config.py
index d4ebb23..3aeba81 100644
--- a/ricky/config.py
+++ b/ricky/config.py
@@ -1,5 +1,5 @@
USERNAME = "RICHARD_GIOVANNI"
-TEST_URL = "http://i.asdf.us/im/fc/imBreak5qI6DN2_1425433157_.png"
+TEST_URL = "http://i.asdf.us/im/65/imBreak5qI6DN2_14254-PbPattern_1444004782_pepper.png"
PATTERN_BASE_URL = "http://asdf.us/impattern/patterns"
IMPATTERN_URL = "http://asdf.us/im/api/impattern"
IMGRID_URL = "http://asdf.us/im/api/imgrid"
diff --git a/ricky/im.py b/ricky/im.py
index 91bf2c1..715d825 100644
--- a/ricky/im.py
+++ b/ricky/im.py
@@ -26,4 +26,4 @@ class Im:
def call(self, params):
if not(params.is_ready()):
raise Exception("Im Params Not Ready")
- return json.loads(self.post_request(self.url, params.as_hash()))
+ return json.loads(self.post_request(self.url, params.as_dict()))
diff --git a/ricky/imbreak/imbreak.py b/ricky/imbreak/imbreak.py
index 9724911..c2a5a61 100644
--- a/ricky/imbreak/imbreak.py
+++ b/ricky/imbreak/imbreak.py
@@ -1,4 +1,4 @@
-from ricky.api import Im
+from ricky.im import Im
from ricky.imbreak.params import ImBreakParams
from ricky.config import IMBREAK_URL
diff --git a/ricky/imgradient/imgradient.py b/ricky/imgradient/imgradient.py
index b6c9a1b..bc04615 100644
--- a/ricky/imgradient/imgradient.py
+++ b/ricky/imgradient/imgradient.py
@@ -1,4 +1,4 @@
-from ricky.api import Im
+from ricky.im import Im
from ricky.imgradient.params import ImGradientParams
from ricky.config import IMGRADIENT_URL
diff --git a/ricky/imgrid/imgrid.py b/ricky/imgrid/imgrid.py
index ed5b43c..3b0b128 100644
--- a/ricky/imgrid/imgrid.py
+++ b/ricky/imgrid/imgrid.py
@@ -1,4 +1,4 @@
-from ricky.api import Im
+from ricky.im import Im
from ricky.imgrid.params import ImGridParams
from ricky.config import IMGRID_URL
diff --git a/ricky/impattern/impattern.py b/ricky/impattern/impattern.py
index 885649c..577623e 100755
--- a/ricky/impattern/impattern.py
+++ b/ricky/impattern/impattern.py
@@ -1,4 +1,4 @@
-from ricky.api import Im
+from ricky.im import Im
from ricky.impattern.params import ImPatternParams
from ricky.config import IMPATTERN_URL
diff --git a/ricky/impattern/params.py b/ricky/impattern/params.py
index 34d70bf..90907fc 100644
--- a/ricky/impattern/params.py
+++ b/ricky/impattern/params.py
@@ -21,7 +21,7 @@ class ImPatternParams(Params):
def __init__(self):
self.params = [
Username(name="username", required=0),
- ImageUrl(name="imageurl", required=1),
+ ImageUrl(name="image_url", required=1),
MultiSelect(name="pattern_url", required=1, options=pattern_url_options)
]
diff --git a/ricky/params.py b/ricky/params.py
index 178643a..73a72fa 100644
--- a/ricky/params.py
+++ b/ricky/params.py
@@ -34,7 +34,7 @@ class Params(object):
sys.stderr.write("param not ready: {}".format(p))
return 0
return 1
- def as_hash(self):
+ def as_dict(self):
result = {}
for p in self.params:
result[p.name] = p.value