mirror of
https://github.com/e1ven/Robohash.git
synced 2025-06-23 21:35:02 +00:00
Cleaned up directoryparam support
This commit is contained in:
parent
4e5295e2aa
commit
51b061522c
@ -1,4 +1,4 @@
|
||||
PIL==1.1.7
|
||||
distribute==0.6.27
|
||||
tornado==2.4
|
||||
tornado==1.2.1
|
||||
wsgiref==0.1.2
|
||||
|
@ -547,6 +547,7 @@ src="//static1.robohash.org/static/img/indented_star.png" width="27" height="25"
|
||||
For example: http://robohash.org/colin@robohash.org?gravatar=yes<br> or http://robohash.org/620050a4db5104bae758cd75171d64ca?gravatar=hashed
|
||||
</p><p>
|
||||
<p>Both traditional and new Stealthy (https) robots are available.</p>
|
||||
<p>We've also conditioned our robots to accept commands either via params or directories-<br> For instance http://robohash.org/set_set3/bgset_bg1/3.14159?size=500x500
|
||||
<p>Finally, the <a href="http://github.com/e1ven/Robohash">Blueprints are available</a> to build your own robotic
|
||||
factory.</p>
|
||||
</p>
|
||||
|
12
webfront.py
12
webfront.py
@ -230,16 +230,16 @@ class ImgHandler(tornado.web.RequestHandler):
|
||||
args[k] = args[k][0]
|
||||
else:
|
||||
args[k] = ""
|
||||
|
||||
|
||||
# IF, and Only IF, there is an arg in the list, should we interpret slashes as params
|
||||
split = string.split('/')
|
||||
if len(split) > 0:
|
||||
string = split[0]
|
||||
|
||||
if len(split) > 1:
|
||||
for str in split[1::]:
|
||||
for str in split:
|
||||
b = str.encode('ascii','ignore').split('_')
|
||||
if len(b) == 2:
|
||||
args[b[0]] = b[1]
|
||||
if b[0] in ['gravatar','ignoreext','size','set','bgset']:
|
||||
args[b[0]] = b[1]
|
||||
string = split[len(split)-1]
|
||||
|
||||
colors = ['blue','brown','green','grey','orange','pink','purple','red','white','yellow']
|
||||
sets = ['set1','set2','set3']
|
||||
|
Loading…
x
Reference in New Issue
Block a user