Commits

Benoit Boissinot committed 7e6209b

better paths

  • Participants
  • Parent commits 70c48af

Comments (0)

Files changed (1)

 
 class Tiles(webapp.RequestHandler):
     def get(self, *args):
-        if args[1] is None or args[2] is None:
+        if not args:
             x, y = 0, 0
         else:
-            x = long(args[1]) % maxrange
-            y = long(args[2]) % maxrange
+            x = long(args[0]) % maxrange
+            y = long(args[1]) % maxrange
 
         t = get_tile(x, y)
         if (x, y) == (0, 0) and (t is None or t.content != welcome_tile):
 
 
 application = webapp.WSGIApplication(
-                                     [(r'/tiles(/(\d+)x(\d+))?', Tiles)],
+                                     [(r'/tiles/(\d+)x(\d+)', Tiles),
+                                      (r'/tiles/?', Tiles)],
                                      debug=True)
 
 def main():