sort backgrounds

This commit is contained in:
Robohash 2012-04-03 12:45:23 -04:00
parent 7cd765811b
commit fd9db99f7c

View File

@ -361,7 +361,9 @@ class ImgHandler(tornado.web.RequestHandler):
if client_bgset is not "":
bglist = []
for ls in os.listdir(client_bgset):
backgrounds = os.listdir(client_bgset)
backgrounds.sort()
for ls in backgrounds:
if not ls.startswith("."):
bglist.append(client_bgset + "/" + ls)
bg = Image.open(bglist[r.hasharray[3] % len(bglist)])