summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbbangert <none@none>2006-02-15 17:08:33 -0800
committerbbangert <none@none>2006-02-15 17:08:33 -0800
commit2e9ff51aefbdad7eb4cc48d61f7b6adaca3e9950 (patch)
tree1332fb70ceb12ca2eafbb45d7b086c9f71242d11
parent9b6a614242f0676b64090e8e10ef12a84d65e1e6 (diff)
downloadroutes-2e9ff51aefbdad7eb4cc48d61f7b6adaca3e9950.tar.gz
[svn] Raises RouteException if match is attempted and regexp's need to be generated
--HG-- branch : trunk
-rw-r--r--routes/base.py2
-rw-r--r--routes/util.py3
2 files changed, 5 insertions, 0 deletions
diff --git a/routes/base.py b/routes/base.py
index 9f7a14d..730e5f4 100644
--- a/routes/base.py
+++ b/routes/base.py
@@ -584,6 +584,8 @@ class Mapper(object):
resultdict = m.match('/joe/sixpack')
"""
+ if not self._created_regs:
+ raise RouteException, "You must generate the regular expressions before matching."
result = self._match(url)
if result:
return result[0]
diff --git a/routes/util.py b/routes/util.py
index 35e8787..ae2e887 100644
--- a/routes/util.py
+++ b/routes/util.py
@@ -181,3 +181,6 @@ def controller_scan(directory):
controllers = find_controllers(directory)
return controllers
+
+class RouteException(Exception):
+ pass