[Checkins] SVN: z3c.pt/trunk/src/z3c/pt/expressions.py API update.
Malthe Borch
mborch at gmail.com
Mon Nov 17 07:37:35 EST 2008
Log message for revision 93042:
API update.
Changed:
U z3c.pt/trunk/src/z3c/pt/expressions.py
-=-
Modified: z3c.pt/trunk/src/z3c/pt/expressions.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/expressions.py 2008-11-17 12:37:18 UTC (rev 93041)
+++ z3c.pt/trunk/src/z3c/pt/expressions.py 2008-11-17 12:37:34 UTC (rev 93042)
@@ -87,6 +87,9 @@
"""
>>> translate = PathTranslator().translate
+ >>> translate("") is None
+ True
+
>>> translate("a/b")
value("_path(a, request, True, 'b')")
@@ -111,6 +114,9 @@
value("_path(context, request, True, '@@%s' % (view,))")
"""
+ if not string:
+ return None
+
if not self.path_regex.match(string.strip()):
raise SyntaxError("Not a valid path-expression: %s." % string)
More information about the Checkins
mailing list