From 72ed4f9edb679bdc5f13b3cde3f98034e9f68c5e Mon Sep 17 00:00:00 2001
From: Colin Davis <colin@e1ven.com>
Date: Tue, 3 Apr 2012 12:45:23 -0400
Subject: [PATCH] sort backgrounds

---
 webfront.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/webfront.py b/webfront.py
index 79e40c1..d4934b9 100755
--- a/webfront.py
+++ b/webfront.py
@@ -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)])