summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpepperpepperpepper <pepper@scannerjammer.com>2015-12-06 17:30:20 -0800
committerpepperpepperpepper <pepper@scannerjammer.com>2015-12-06 17:30:20 -0800
commit8ebd9d7eb7b3289a722cdae6a4bdcdd4cd21ff86 (patch)
treeed19bc96ee19653c09ef1d29df9c1cc9ef9e5d49
parent86f6c859270a37d600292a7bc7c99dc7f8fa70f8 (diff)
cleaned up names
-rwxr-xr-xexample.py10
m---------photoblaster0
-rw-r--r--ricky/config.py1
-rw-r--r--ricky/im.py33
-rw-r--r--ricky/imbreak/__init__.py12
-rw-r--r--ricky/imbreak/params.py58
-rw-r--r--ricky/imbreak/probability.json35
-rw-r--r--ricky/imgradient/__init__.py15
-rw-r--r--ricky/imgradient/params.py166
-rw-r--r--ricky/imgradient/probabilities.json120
-rw-r--r--ricky/imgrid/__init__.py14
-rwxr-xr-xricky/imgrid/options.py63
-rw-r--r--ricky/imgrid/params.py130
-rw-r--r--ricky/imgrid/probabilities.json87
-rwxr-xr-xricky/impattern/__init__.py14
-rw-r--r--ricky/impattern/params.py24
-rw-r--r--ricky/param/imageurl.py4
17 files changed, 8 insertions, 778 deletions
diff --git a/example.py b/example.py
index d78b809..d34c3f6 100755
--- a/example.py
+++ b/example.py
@@ -1,11 +1,11 @@
#!/usr/bin/python2.7
-from ricky.imgradient import ImGradient
-from ricky.imbreak import ImBreak
-from ricky.imgrid import ImGrid
-from ricky.impattern import ImPattern
+from ricky.pbgradient import PbGradient
+from ricky.pbbreaker import PbBreaker
+from ricky.pbgrid import PbGrid
+from ricky.pbpattern import PbPattern
-api = ImPattern()
+api = PbPattern()
params = api.params_init()
print params
params.randomize()
diff --git a/photoblaster b/photoblaster
-Subproject 077a335fe8ab030f14c15c64bf902193d4ad49f
+Subproject 2f4bd6a0cf0c9a38b527bde3e6e903a2770ff5d
diff --git a/ricky/config.py b/ricky/config.py
index 15c2c0d..819def3 100644
--- a/ricky/config.py
+++ b/ricky/config.py
@@ -9,3 +9,4 @@ IMPATTERN_URL = "http://localhost:8999/im/api/impattern"
IMGRID_URL = "http://localhost:8999/im/api/imgrid"
IMGRADIENT_URL = "http://localhost:8999/im/api/imgradient"
IMBREAK_URL = "http://localhost:8999/im/api/imbreak"
+OFFLINE = False
diff --git a/ricky/im.py b/ricky/im.py
deleted file mode 100644
index 3f94e94..0000000
--- a/ricky/im.py
+++ /dev/null
@@ -1,33 +0,0 @@
-import urllib
-import urllib2
-import sys
-import simplejson as json
-
-
-class Im(object):
- def __init__(self):
- self._required_keys = []
- self.url = ""
-
- def post_request(self, url, params):
- params = urllib.urlencode(params)
- headers = {
- "Content-type": "application/x-www-form-urlencoded",
- "User-Agent": (
- "Mozilla/5.0 (X11; Linux x86_64) "
- "AppleWebKit/537.36 (KHTML, like Gecko) "
- "Chrome/40.0.2214.94 Safari/537.36"
- ),
- "Accept": "text/plain"
- }
- try:
- req = urllib2.Request(url, params, headers)
- response = urllib2.urlopen(req)
- return response.read()
- except urllib.error.HTTPError:
- sys.stderr.write("Post Request failed!")
-
- def call(self, params):
- return json.loads(
- self.post_request(self.url, params.as_dict())
- )
diff --git a/ricky/imbreak/__init__.py b/ricky/imbreak/__init__.py
deleted file mode 100644
index c2a5a61..0000000
--- a/ricky/imbreak/__init__.py
+++ /dev/null
@@ -1,12 +0,0 @@
-from ricky.im import Im
-from ricky.imbreak.params import ImBreakParams
-from ricky.config import IMBREAK_URL
-
-class ImBreak(Im):
- def __init__(self):
- self.url = IMBREAK_URL
- def params_init(self):
- new_params = ImBreakParams()
- #new_params = self.get_from_server()
- new_params.api = self
- return new_params
diff --git a/ricky/imbreak/params.py b/ricky/imbreak/params.py
deleted file mode 100644
index 90ad41d..0000000
--- a/ricky/imbreak/params.py
+++ /dev/null
@@ -1,58 +0,0 @@
-from ricky.params import Params
-from ricky.param.username import Username
-from ricky.param.imageurl import ImageUrl
-from ricky.param.enum import Enum
-from ricky.param.constrainednumber import ConstrainedNumber
-from ricky.param.bool import Bool
-
-
-_BREAKTYPE_OPTIONS = [
- "CLASSIC",
- "REDUX",
- "BLURRY_BREAK",
- "BLURRY_BREAK_2",
- "SWIPE",
- "RGB_WASH",
- "RGB_WASH_2",
- "NOISY_BREAK",
- "BROKEN_VIGNETTE",
- "FAX_MACHINE",
- "STRIPES",
- "PHOTOCOPY"
-]
-_BREAKMODE_OPTIONS = [
- "extreme",
- "subtle",
-]
-_FINALFORMAT_OPTIONS = [
- "png",
- "jpg",
- "gif",
-]
-
-
-class ImBreakParams(Params):
- def __init__(self):
- self._params = (
- Username(name="username", required=False),
- ImageUrl(name="url", required=True),
- Enum(
- name="finalformat",
- required=False,
- options=_FINALFORMAT_OPTIONS),
- Enum(
- name="breaktype",
- required=True,
- options=_BREAKTYPE_OPTIONS),
- ConstrainedNumber(
- name="breakangle",
- required=False,
- enforce_int=True,
- min=-180,
- max=180),
- Enum(
- name="breakmode",
- required=True,
- options=_BREAKMODE_OPTIONS),
- Bool(name="expanded", required=False)
- )
diff --git a/ricky/imbreak/probability.json b/ricky/imbreak/probability.json
deleted file mode 100644
index 9c28e6d..0000000
--- a/ricky/imbreak/probability.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "breaktype" :[
- {"value": "CLASSIC", "weight": 1},
- {"value": "REDUX", "weight": 1},
- {"value": "BLURRY_BREAK", "weight": 1},
- {"value": "BLURRY_BREAK_2", "weight": 1},
- {"value": "SWIPE", "weight": 1},
- {"value": "RGB_WASH", "weight": 1},
- {"value": "RGB_WASH_2", "weight": 1},
- {"value": "NOISY_BREAK", "weight": 1},
- {"value": "BROKEN_VIGNETTE", "weight": 1},
- {"value": "FAX_MACHINE", "weight": 1},
- {"value": "STRIPES", "weight": 1},
- {"value": "PHOTOCOPY", "weight": 1}
- ],
- "breakmode" :[
- {"value": "extreme", "weight": 1},
- {"value": "subtle", "weight": 1}
- ],
- "finalformat" :[
- {"value": "png", "weight": 5},
- {"value": "jpg", "weight": 2},
- {"value": "gif", "weight": 2}
- ],
- "breakangle" :[
- {"value": 0, "weight": 9},
- {"value": 90, "weight": 2},
- {"value": -180, "weight": 2},
- {"value": 180, "weight": 2}
- ],
- "expanded" :[
- {"value": "", "weight": 11},
- {"value": 1, "weight": 2}
- ]
-}
diff --git a/ricky/imgradient/__init__.py b/ricky/imgradient/__init__.py
deleted file mode 100644
index a8ed8a6..0000000
--- a/ricky/imgradient/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-"""class for the imgradient api handler"""
-from ricky.im import Im
-from ricky.imgradient.params import Params
-from ricky.config import IMGRADIENT_URL
-
-
-class ImGradient(Im):
- def __init__(self):
- super(ImGradient, self).__init__()
- self.url = IMGRADIENT_URL
-
- def params_init(self):
- new_params = Params()
- new_params.api = self
- return new_params
diff --git a/ricky/imgradient/params.py b/ricky/imgradient/params.py
deleted file mode 100644
index 48e25f5..0000000
--- a/ricky/imgradient/params.py
+++ /dev/null
@@ -1,166 +0,0 @@
-from ricky.params import Params as _Params
-from ricky.param.username import Username
-from ricky.param.enum import Enum
-from ricky.param.constrainednumber import ConstrainedNumber
-from ricky.param.bool import Bool
-from ricky.param.color import Color
-
-
-_HALFTONE_OPTIONS = [
- "",
- "checkeredfade",
- "etchedtransition",
- "bendaydots",
- "smallerdots1",
- "smallerdots2",
- "flatstripes",
-]
-
-_BEVEL_OPTIONS = [
- "",
- "flatout",
- "flatinner",
- "evenlyframed",
- "biginner",
- "bigouter",
- "dramaticflatout",
- "dramaticflatinner",
-]
-
-_FILETYPE_OPTIONS = [
- "png",
- "jpg",
- "gif",
-]
-
-_GRADIENTTYPE_OPTIONS = [
- "canvas",
- "gradient",
- "radial",
- "colorspace",
- "plasmawash",
- "gradientwash",
- "mirrored",
- "noise",
-]
-
-
-class Params(_Params):
- def __init__(self):
- super(Params, self).__init__(
- Username(name="username", required=False),
- ConstrainedNumber(
- name="width",
- required=True,
- enforce_int=True,
- min=10,
- max=800
- ),
- ConstrainedNumber(
- name="height",
- required=True,
- enforce_int=True,
- min=10,
- max=800
- ),
- Color(name="color1", required=True),
- Color(name="color2", required=True),
- Enum(
- name="filetype",
- required=False,
- options=_FILETYPE_OPTIONS
- ),
- Enum(
- name="gradienttype",
- required=True,
- options=_GRADIENTTYPE_OPTIONS
- ),
- Enum(
- name="halftone",
- required=False,
- options=_HALFTONE_OPTIONS
- ),
- Enum(
- name="bevel",
- required=False,
- options=_BEVEL_OPTIONS
- ),
- ConstrainedNumber(
- name="stripenumber",
- required=False,
- enforce_int=True,
- min=0,
- max=400
- ),
- ConstrainedNumber(
- name="stripeintensity",
- required=False,
- enforce_int=True,
- min=0,
- max=5000
- ),
- ConstrainedNumber(
- name="blurriness",
- required=False,
- enforce_int=True,
- min=0,
- max=200
- ),
- ConstrainedNumber(
- name="contrast",
- required=False,
- enforce_int=True,
- min=0,
- max=200
- ),
- ConstrainedNumber(
- name="brightness",
- required=False,
- enforce_int=True,
- min=0,
- max=200
- ),
- ConstrainedNumber(
- name="saturation",
- required=False,
- enforce_int=True,
- min=0,
- max=200
- ),
- ConstrainedNumber(
- name="hue",
- required=False,
- enforce_int=True,
- min=0,
- max=200
- ),
- ConstrainedNumber(
- name="percentbeveled",
- required=False,
- enforce_int=True,
- min=0,
- max=100
- ),
- ConstrainedNumber(
- name="rotate",
- required=False,
- enforce_int=True,
- min=0,
- max=360
- ),
- ConstrainedNumber(
- name="tilt",
- required=False,
- enforce_int=True,
- min=0,
- max=360
- ),
- Bool(
- name="flop",
- required=False,
- ),
- Bool(
- name="flip",
- required=False
- )
- )
diff --git a/ricky/imgradient/probabilities.json b/ricky/imgradient/probabilities.json
deleted file mode 100644
index 0c6c0df..0000000
--- a/ricky/imgradient/probabilities.json
+++ /dev/null
@@ -1,120 +0,0 @@
-{
- "width" : [
- {"value": 40, "weight": 10}
- ],
- "height" : [
- {"value": 400, "weight": 100}
- ],
- "color1" : [
- {"value": "", "weight": 0},
- {"value": "black", "weight": 1},
- {"value": "white", "weight": 2}
- ],
- "color2" : [
- {"value": "", "weight": 0},
- {"value": "black", "weight": 2},
- {"value": "white", "weight": 1}
- ],
- "stripes" : [
- {"value": "true", "weight": 3},
- {"value": "false", "weight": 1}
- ],
- "stripenumber" : [
- {"value": 3, "weight": 10},
- {"value": 10, "weight": 10},
- {"value": 20, "weight": 10},
- {"value": 100, "weight": 10},
- {"value": 40, "weight": 10},
- {"value": 1, "weight": 50},
- {"value": 2, "weight": 50},
- {"value": 2, "weight": 50}
- ],
- "stripeintensity" : [
- {"value": 1000, "weight": 10},
- {"value": 4, "weight": 10}
- ],
- "contrast" : [
- {"value": "", "weight": 0},
- {"value": "", "weight": 300}
- ],
- "brightness" : [
- {"value": "", "weight": 0},
- {"value": "", "weight": 300}
- ],
- "saturation" : [
- {"value": "", "weight": 0},
- {"value": "", "weight": 300}
- ],
- "hue" : [
- {"value": "", "weight": 0},
- {"value": "", "weight": 300}
- ],
- "halftone" : [
- {"value": "", "weight": 60},
- {"value": "checkeredfade", "weight": 10},
- {"value": "etchedtransition", "weight": 10},
- {"value": "bendaydots", "weight": 10},
- {"value": "smallerdots1", "weight": 10},
- {"value": "smallerdots2", "weight": 10},
- {"value": "flatstripes", "weight": 10}
- ],
- "bevel" : [
- {"value": "", "weight": 4},
- {"value": "flatout", "weight": 1},
- {"value": "flatinner", "weight": 0},
- {"value": "evenlyframed", "weight": 1},
- {"value": "biginner", "weight": 1},
- {"value": "bigouter", "weight": 1},
- {"value": "dramaticflatout", "weight": 1},
- {"value": "dramaticflatinner", "weight": 1}
- ],
- "blurriness" : [
- {"value": 30, "weight": 10},
- {"value": 10, "weight": 10},
- {"value": 5, "weight": 10},
- {"value": 20, "weight": 10},
- {"value": 25, "weight": 10},
- {"value": 7, "weight": 10},
- {"value": "", "weight": 1}
- ],
- "percentbeveled" : [
- {"value": 30, "weight": 10},
- {"value": 10, "weight": 10},
- {"value": 5, "weight": 10},
- {"value": 20, "weight": 10},
- {"value": 25, "weight": 10},
- {"value": 7, "weight": 10},
- {"value": "", "weight": 1}
- ],
- "rotate" : [
- {"value": 0, "weight": 200},
- {"value": 90, "weight": 2},
- {"value": 180, "weight": 2},
- {"value": 270, "weight": 2}
- ],
- "tilt" : [
- {"value": 0, "weight": 200},
- {"value": 90, "weight": 2},
- {"value": 180, "weight": 2},
- {"value": 270, "weight": 2}
- ],
- "flop_probabilities : flip" : [
- {"value": "", "weight": 1},
- {"value": "true", "weight": 1}
- ],
- "filetype" : [
- {"value": "png", "weight": 10},
- {"value": "jpg", "weight": 2},
- {"value": "gif", "weight": 2}
- ],
- "gradienttype" : [
- {"value": "canvas", "weight": 1},
- {"value": "gradient", "weight": 5},
- {"value": "radial", "weight": 1},
- {"value": "colorspace", "weight": 1},
- {"value": "plasmawash", "weight": 2},
- {"value": "gradientwash", "weight": 1},
- {"value": "mirrored", "weight": 0},
- {"value": "noise", "weight": 1}
- ]
-}
diff --git a/ricky/imgrid/__init__.py b/ricky/imgrid/__init__.py
deleted file mode 100644
index e977115..0000000
--- a/ricky/imgrid/__init__.py
+++ /dev/null
@@ -1,14 +0,0 @@
-from ricky.im import Im
-from ricky.imgrid.params import Params
-from ricky.config import IMGRID_URL
-
-
-class ImGrid(Im):
- def __init__(self):
- self.url = IMGRID_URL
-
- def params_init(self):
- new_params = Params()
- # new_params = self.get_from_server()
- new_params.api = self
- return new_params
diff --git a/ricky/imgrid/options.py b/ricky/imgrid/options.py
deleted file mode 100755
index 38ba1ee..0000000
--- a/ricky/imgrid/options.py
+++ /dev/null
@@ -1,63 +0,0 @@
-format_probabilities = Probabilities.from_dict(
- { 'weight': 20, 'value': 'png' },
- { 'weight': 0, 'value': 'gif' },
- { 'weight': 0, 'value': 'jpg' },
-)
-transition_probabilities = Probabilities.from_dict(
- { "value" : "background", "weight": 1 },
- { "value" : "dither", "weight": 1 },
- { "value" : "random", "weight": 1 },
- { "value" : "tile", "weight": 1 },
- { "value" : "edge", "weight": 1 },
-)
-skycolor_colors = \
- bgcolor_colors = planebgcolor_colors = Probabilities.from_dict(
- { "value" : "white", "weight" : 1 },
- { "value" : "silver", "weight" : 1 },
- { "value" : None, "weight" : 10 },
-)
-
-linecolor_colors = Probabilities.from_dict(
- { "value" : "black", "weight" : 1 },
- { "value" : "white", "weight" : 1 },
- { "value" : "silver", "weight" : 1 },
-)
-swing_probabilities = tilt_probabilities = roll_probabilities = Probabilities.from_dict(
- {"value": "", "weight": 2},
- {"value": 30, "weight": 1},
- {"value": -30, "weight": 1},
-)
-width_probabilities = height_probabilities = Probabilities.from_dict(
- { "value" : 400, "weight" : 1 },
- { "value" : 600, "weight" : 1 },
-)
-linethickness_probabilities = Probabilities.from_dict(
- {"value":1, "weight": 2},
- {"value":2, "weight": 1},
-)
-opacity_probabilities = Probabilities.from_dict(
- {"value":1, "weight": 2},
- {"value":0.5, "weight": 1},
-)
-spacing_probabilities = Probabilities.from_dict(
- {"value":10, "weight": 1},
- {"value":15, "weight": 1},
-)
-vlines_probabilities = hlines_probabilities = Probabilities.from_dict(
- {"value":"", "weight": 2},
- {"value":"true", "weight": 1},
-)
-shadow_probabilities = Probabilities.from_dict(
- {"value":"", "weight": 1},
- {"value":"true", "weight": 1},
-)
-zoom_probabilities = Probabilities.from_dict(
- {"value": 0, "weight": 3},
- {"value": 1.2, "weight": 1},
- {"value": -1.2, "weight": 1},
-)
-trim_probabilities = Probabilities.from_dict(
- {"value":"", "weight": 1},
- {"value":"true", "weight": 1},
-)
-
diff --git a/ricky/imgrid/params.py b/ricky/imgrid/params.py
deleted file mode 100644
index 01f1ff7..0000000
--- a/ricky/imgrid/params.py
+++ /dev/null
@@ -1,130 +0,0 @@
-from ricky.params import Params as _Params
-from ricky.param.username import Username
-from ricky.param.imageurl import ImageUrl
-from ricky.param.enum import Enum
-from ricky.param.constrainednumber import ConstrainedNumber
-from ricky.param.color import Color
-from ricky.param.bool import Bool
-
-_TRANSITION_OPTIONS = [
- "background",
- "dither",
- "random",
- "tile",
- "edge"
-]
-
-_FILETYPE_OPTIONS = [
- "png",
- "jpg",
- "gif",
-]
-
-
-class Params(_Params):
- def __init__(self):
- self._params = (
- Username(name="username", required=False),
- ImageUrl(name="bgimage", required=False),
- ImageUrl(name="imageinstead", required=False),
- ImageUrl(name="planebgimage", required=False),
- Enum(
- name="format",
- required=False,
- options=_FILETYPE_OPTIONS
- ),
- Enum(
- name="transition",
- required=True,
- options=_TRANSITION_OPTIONS
- ),
- Color(name="skycolor", required=False),
- Color(name="planebgcolor", required=False),
- Color(name="bgcolor", required=False),
- Color(name="linecolor", required=False),
- ConstrainedNumber(
- name="swing",
- required=False,
- enforce_int=True,
- min=-170,
- max=170),
- ConstrainedNumber(
- name="tilt",
- required=False,
- enforce_int=True,
- min=-170,
- max=170),
- ConstrainedNumber(
- name="roll",
- required=False,
- enforce_int=True,
- min=-170,
- max=170),
- ConstrainedNumber(
- name="width",
- required=False,
- enforce_int=True,
- min=100,
- max=800),
- ConstrainedNumber(
- name="height",
- required=False,
- enforce_int=True,
- min=100,
- max=800),
- ConstrainedNumber(
- name="linethickness",
- required=False,
- enforce_int=True,
- min=1,
- max=30
- ),
- ConstrainedNumber(
- name="opacity", required=False, min=0, max=1, prec=2),
- ConstrainedNumber(
- name="spacing",
- enforce_int=True,
- required=False,
- min=2,
- max=100),
- Bool(name="vlines", required=False),
- Bool(name="hlines", required=False),
- Bool(name="trim", required=False),
- Bool(name="shadow", required=False),
- ConstrainedNumber(
- name="zoom",
- required=False,
- min=-12,
- max=12,
- forbidden_range_min=-1.1,
- forbidden_range_max=1.1,
- prec=1
- )
- )
-
- def _test_values(self):
- return not any([
- (self.__getitem__('spacing').value >
- self.__getitem__('width').value),
- (self.__getitem__('spacing').value >
- self.__getitem__('height').value),
- (self.__getitem__('linethickness').value >
- self.__getitem__('width').value),
- (self.__getitem__('linethickness').value >
- self.__getitem__('height').value),
- ])
-
- def randomize(self):
- p = self._params
- for el in p:
- if el in ['spacing', 'linethickness']:
- continue
- el.randomize()
- for name in ['spacing', 'linethickness']:
- max_tries = 10000
- while(max_tries):
- self.__getitem__(name).randomize()
- if self._test_values():
- return
- max_tries -= 1
- raise ValueError
diff --git a/ricky/imgrid/probabilities.json b/ricky/imgrid/probabilities.json
deleted file mode 100644
index f9defe8..0000000
--- a/ricky/imgrid/probabilities.json
+++ /dev/null
@@ -1,87 +0,0 @@
-{
- "format" : [
- { "weight": 20, "value": "png" },
- { "weight": 0, "value": "gif" },
- { "weight": 0, "value": "jpg" }
- ],
- "transition" : [
- { "value" : "background", "weight": 1 },
- { "value" : "dither", "weight": 1 },
- { "value" : "random", "weight": 1 },
- { "value" : "tile", "weight": 1 },
- { "value" : "edge", "weight": 1 }
- ],
- "skycolor" : [
- { "value" : "white", "weight" : 1 },
- { "value" : "silver", "weight" : 1 },
- { "value" : null, "weight" : 10 }
- ],
- "bgcolor" : [
- { "value" : "white", "weight" : 1 },
- { "value" : "silver", "weight" : 1 },
- { "value" : null, "weight" : 10 }
- ],
- "planebgcolor" : [
- { "value" : "white", "weight" : 1 },
- { "value" : "silver", "weight" : 1 },
- { "value" : null, "weight" : 10 }
- ],
-
- "linecolor" : [
- { "value" : "black", "weight" : 1 },
- { "value" : "white", "weight" : 1 },
- { "value" : "silver", "weight" : 1 }
- ],
- "swing" : [
- {"value": ", "weight": 2},
- {"value": 30, "weight": 1},
- {"value": -30, "weight": 1}
- ],
- "tilt" : [
- {"value": ", "weight": 2},
- {"value": 30, "weight": 1},
- {"value": -30, "weight": 1}
- ],
- "roll" : [
- {"value": ", "weight": 2},
- {"value": 30, "weight": 1},
- {"value": -30, "weight": 1}
- ],
- "width" : "height" : [
- { "value" : 400, "weight" : 1 },
- { "value" : 600, "weight" : 1 }
- ],
- "linethickness" : [
- {"value":1, "weight": 2},
- {"value":2, "weight": 1}
- ],
- "opacity" : [
- {"value":1, "weight": 2},
- {"value":0.5, "weight": 1}
- ],
- "spacing" : [
- {"value":10, "weight": 1},
- {"value":15, "weight": 1}
- ],
- "vlines" : [
- {"value":", "weight": 2},
- {"value":"true", "weight": 1}
- ],
- "hlines" : [
- {"value":", "weight": 2},
- {"value":"true", "weight": 1}
- ],
- "shadow" : [
- {"value":", "weight": 1},
- {"value":"true", "weight": 1}
- ],
- "zoom" : [
- {"value": 0, "weight": 3},
- {"value": 1.2, "weight": 1},
- {"value": -1.2, "weight": 1}
- ],
- "trim" : [
- {"value":", "weight": 1},
- {"value":"true", "weight": 1}
- ]
-}
diff --git a/ricky/impattern/__init__.py b/ricky/impattern/__init__.py
deleted file mode 100755
index 071a316..0000000
--- a/ricky/impattern/__init__.py
+++ /dev/null
@@ -1,14 +0,0 @@
-from ricky.im import Im
-from ricky.impattern.params import Params
-from ricky.config import IMPATTERN_URL
-
-
-class ImPattern(Im):
- def __init__(self):
- self.url = IMPATTERN_URL
-
- def params_init(self):
- new_params = Params()
- # new_params = self.get_from_server()
- new_params.api = self
- return new_params
diff --git a/ricky/impattern/params.py b/ricky/impattern/params.py
deleted file mode 100644
index 20f64d0..0000000
--- a/ricky/impattern/params.py
+++ /dev/null
@@ -1,24 +0,0 @@
-from ricky.params import Params as _Params
-from ricky.param.username import Username
-from ricky.param.imageurl import ImageUrl
-from ricky.param.enum import Enum
-from ricky.config import PATTERN_URL_BASE
-
-
-class Params(_Params):
- def __init__(self):
- self._params = (
- Username(name="username", required=False),
- ImageUrl(name="image_url", required=True),
- Enum(
- name="pattern_url",
- required=True,
- options=self._get_pattern_urls()
- )
- )
-
- def _get_pattern_urls(self):
- return set(
- ["%s/img/%s.png" % (PATTERN_URL_BASE, i) for i in xrange(0, 97)] +
- ["%s/img/a%s.png" % (PATTERN_URL_BASE, i) for i in xrange(1, 42)]
- )
diff --git a/ricky/param/imageurl.py b/ricky/param/imageurl.py
index 8b4aff4..768530b 100644
--- a/ricky/param/imageurl.py
+++ b/ricky/param/imageurl.py
@@ -2,8 +2,8 @@ from ricky.config import TEST_URL
from ricky.param.string import String
-class ImageUrl(String):
+class PbageUrl(String):
def __init__(self, *args, **kwargs):
if 'default' not in kwargs:
kwargs['default'] = TEST_URL
- super(ImageUrl, self).__init__(*args, **kwargs)
+ super(PbageUrl, self).__init__(*args, **kwargs)