[Zope3-checkins] CVS: Zope3/src/zope/tal - taldefs.py:1.4
Fred L. Drake, Jr.
fred@zope.com
Fri, 4 Apr 2003 10:49:07 -0500
Update of /cvs-repository/Zope3/src/zope/tal
In directory cvs.zope.org:/tmp/cvs-serv25747
Modified Files:
taldefs.py
Log Message:
- add hyphen to the set of allowed characters in a replacement name
(non-leading only)
- add note that NAME_RE must exactly match the one in
zope.i18n.simpletranslationservice
- add missing spaces to error messages
=== Zope3/src/zope/tal/taldefs.py 1.3 => 1.4 ===
--- Zope3/src/zope/tal/taldefs.py:1.3 Thu Mar 20 14:41:27 2003
+++ Zope3/src/zope/tal/taldefs.py Fri Apr 4 10:49:07 2003
@@ -26,7 +26,9 @@
ZOPE_METAL_NS = "http://xml.zope.org/namespaces/metal"
ZOPE_I18N_NS = "http://xml.zope.org/namespaces/i18n"
-NAME_RE = "[a-zA-Z_][a-zA-Z0-9_]*"
+# This RE must exactly match the expression of the same name in the
+# zope.i18n.simpletranslationservice module:
+NAME_RE = "[a-zA-Z_][-a-zA-Z0-9_]*"
KNOWN_METAL_ATTRIBUTES = [
"define-macro",
@@ -115,12 +117,12 @@
for part in splitParts(arg):
m = _attr_re.match(part)
if not m:
- raise TALError("Bad syntax in attributes:" + `part`)
+ raise TALError("Bad syntax in attributes: " + `part`)
name, expr = m.group(1, 2)
if not xml:
name = name.lower()
if dict.has_key(name):
- raise TALError("Duplicate attribute name in attributes:" + `part`)
+ raise TALError("Duplicate attribute name in attributes: " + `part`)
dict[name] = expr
return dict