[Zope3-checkins] CVS: StandaloneZConfig/ZConfig - datatypes.py:1.23
Fred L. Drake, Jr.
fred at zope.com
Mon Jan 12 00:57:32 EST 2004
Update of /cvs-repository/StandaloneZConfig/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv21398
Modified Files:
datatypes.py
Log Message:
support ~ expansion in path names; closes Zope3 collector issue 191
=== StandaloneZConfig/ZConfig/datatypes.py 1.22 => 1.23 ===
--- StandaloneZConfig/ZConfig/datatypes.py:1.22 Fri Jan 2 09:17:34 2004
+++ StandaloneZConfig/ZConfig/datatypes.py Mon Jan 12 00:57:31 2004
@@ -227,27 +227,31 @@
return RegularExpressionConversion.__call__(self, value).lower()
def existing_directory(v):
- if os.path.isdir(v):
- return v
+ nv = os.path.expanduser(v)
+ if os.path.isdir(nv):
+ return nv
raise ValueError, '%s is not an existing directory' % v
def existing_path(v):
- if os.path.exists(v):
- return v
+ nv = os.path.expanduser(v)
+ if os.path.exists(nv):
+ return nv
raise ValueError, '%s is not an existing path' % v
def existing_file(v):
- if os.path.exists(v):
- return v
+ nv = os.path.expanduser(v)
+ if os.path.exists(nv):
+ return nv
raise ValueError, '%s is not an existing file' % v
def existing_dirpath(v):
- dir = os.path.dirname(v)
+ nv = os.path.expanduser(v)
+ dir = os.path.dirname(nv)
if not dir:
# relative pathname with no directory component
- return v
+ return nv
if os.path.isdir(dir):
- return v
+ return nv
raise ValueError, ('The directory named as part of the path %s '
'does not exist.' % v)
More information about the Zope3-Checkins
mailing list