[CMF-checkins] CVS: CMF/CMFCore - DirectoryView.py:1.42
Shane Hathaway
shane at zope.com
Sat Apr 3 11:57:30 EST 2004
Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv22829
Modified Files:
DirectoryView.py
Log Message:
There's no need to pay the os.walk penalty except on Windows.
=== CMF/CMFCore/DirectoryView.py 1.41 => 1.42 ===
--- CMF/CMFCore/DirectoryView.py:1.41 Mon Jan 12 05:26:10 2004
+++ CMF/CMFCore/DirectoryView.py Sat Apr 3 11:57:29 2004
@@ -17,6 +17,7 @@
import re
from os import path, listdir, stat
+import sys
from sys import exc_info
from types import StringType
@@ -119,12 +120,13 @@
try:
fp = expandpath(self.filepath)
mtime = stat(fp)[8]
- # some Windows directories don't change mtime
- # when a file is added to or deleted from them :-(
- # So keep a list of files as well, and see if that
- # changes
- path.walk(fp,_walker,filelist)
- filelist.sort()
+ if sys.platform == 'nt':
+ # some Windows directories don't change mtime
+ # when a file is added to or deleted from them :-(
+ # So keep a list of files as well, and see if that
+ # changes
+ path.walk(fp,_walker,filelist)
+ filelist.sort()
except:
LOG('DirectoryView',
ERROR,
More information about the CMF-checkins
mailing list