summaryrefslogtreecommitdiff
path: root/ricky/params/pbpattern.py
diff options
context:
space:
mode:
Diffstat (limited to 'ricky/params/pbpattern.py')
-rw-r--r--ricky/params/pbpattern.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/ricky/params/pbpattern.py b/ricky/params/pbpattern.py
new file mode 100644
index 0000000..2b467ef
--- /dev/null
+++ b/ricky/params/pbpattern.py
@@ -0,0 +1,25 @@
+from ricky.params import Params
+from ricky.param.username import Username
+from ricky.param.imageurl import PbageUrl
+from ricky.param.enum import Enum
+from ricky.config import PATTERN_URL_BASE, PBPATTERN_URL
+
+
+class PbPattern(Params):
+ def __init__(self):
+ super(Params, self).__init__(
+ Username(name="username", required=False),
+ PbageUrl(name="image_url", required=True),
+ Enum(
+ name="pattern_url",
+ required=True,
+ options=self._get_pattern_urls()
+ )
+ )
+ self._url = PBPATTERN_URL
+
+ 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)]
+ )