[Checkins] SVN: z3c.pt/trunk/src/z3c/pt/expressions.py A dot can be used in content provider's names.
Sylvain Viollon
sylvain at infrae.com
Thu Oct 30 11:26:52 EDT 2008
Log message for revision 92704:
A dot can be used in content provider's names.
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-10-30 14:08:43 UTC (rev 92703)
+++ z3c.pt/trunk/src/z3c/pt/expressions.py 2008-10-30 15:26:49 UTC (rev 92704)
@@ -34,7 +34,7 @@
base = next
continue
else:
- # special-case dicts for performance reasons
+ # special-case dicts for performance reasons
if isinstance(base, dict):
base = base[name]
else:
@@ -57,7 +57,7 @@
path_traverse = ZopeTraverser()
symbol = '_path'
-
+
def validate(self, string):
"""
>>> validate = PathTranslator().validate
@@ -109,7 +109,7 @@
# map 'nothing' to 'None'
parts = map(lambda part: part == 'nothing' and 'None' or part, parts)
-
+
base = parts[0]
components = [repr(part) for part in parts[1:]]
@@ -139,11 +139,11 @@
cp.update()
return cp.render()
-
+
class ProviderTranslator(expressions.ExpressionTranslator):
- provider_regex = re.compile(r'^[A-Za-z][A-Za-z0-9_-]*$')
+ provider_regex = re.compile(r'^[A-Za-z][A-Za-z0-9_\.-]*$')
symbol = '_get_content_provider'
-
+
def validate(self, string):
if self.provider_regex.match(string) is None:
raise SyntaxError(
@@ -154,5 +154,5 @@
(self.symbol, string))
value.symbol_mapping[self.symbol] = get_content_provider
return value
-
+
provider_translator = ProviderTranslator()
More information about the Checkins
mailing list