diff roundup/web/router.py @ 4924:6ee1844019d5 routing

routing: Add DEBUG flag for troubleshooting
author anatoly techtonik <techtonik@gmail.com>
date Wed, 20 Aug 2014 13:36:08 +0300
parents 35dc9191394d
children 997fa47c92d5
line wrap: on
line diff
--- a/roundup/web/router.py	Tue Aug 12 01:10:59 2014 +0300
+++ b/roundup/web/router.py	Wed Aug 20 13:36:08 2014 +0300
@@ -7,9 +7,11 @@
   anatoly techtonik <techtonik@gmail.com>
 """
 
+DEBUG = False
+
+
 import re
 
-
 # --- Example URL mapping
 
 class NamedObject(object):
@@ -51,6 +53,8 @@
         path = urlpath.lstrip('/')
         for i in range(0, len(self.urlmap), 2):
             pattern, handler = self.urlmap[i], self.urlmap[i+1]
+            if DEBUG:
+                print('router: matching %s' % pattern)
             match = re.match(pattern, path)
             if match:
                 return handler, match.groups()

Roundup Issue Tracker: http://roundup-tracker.org/