[Zodb-checkins] CVS: Packages/ZConfig - datatypes.py:1.6

Fred L. Drake, Jr. fred@zope.com
Wed, 15 Jan 2003 10:02:52 -0500


Update of /cvs-repository/Packages/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv16613

Modified Files:
	datatypes.py 
Log Message:
- tighten up the regular expression for hostnames
- convert hostnames to lower case


=== Packages/ZConfig/datatypes.py 1.5 => 1.6 ===
--- Packages/ZConfig/datatypes.py:1.5	Thu Jan  9 11:34:43 2003
+++ Packages/ZConfig/datatypes.py	Wed Jan 15 10:02:18 2003
@@ -200,8 +200,11 @@
                 r"(\d|[01]?\d\d|2[0-4]\d|25[0-5])\." #ipaddr cont'd
                 r"(\d|[01]?\d\d|2[0-4]\d|25[0-5])\." #ipaddr cont'd
                 r"(\d|[01]?\d\d|2[0-4]\d|25[0-5])$)" #ipaddr cont'd
-                r"|([^0-9][A-Za-z0-9-_.]+)") # or hostname
+                r"|([A-Za-z_][-A-Za-z0-9_.]*[-A-Za-z0-9_])") # or hostname
         RegularExpressionConversion.__init__(self, expr)
+
+    def __call__(self, value):
+        return RegularExpressionConversion.__call__(self, value).lower()
 
 def existing_directory(v):
     if os.path.isdir(v):