[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/publisher/fileresource.py cleanup:

Fred L. Drake, Jr. fdrake at gmail.com
Fri Aug 6 15:10:25 EDT 2004


Log message for revision 26943:
  cleanup:
  - use the libraries instead of re-implementing path operations
  - re-order imports
  


Changed:
  U   Zope3/trunk/src/zope/app/publisher/fileresource.py


-=-
Modified: Zope3/trunk/src/zope/app/publisher/fileresource.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/fileresource.py	2004-08-06 18:57:44 UTC (rev 26942)
+++ Zope3/trunk/src/zope/app/publisher/fileresource.py	2004-08-06 19:10:25 UTC (rev 26943)
@@ -15,11 +15,15 @@
 
 $Id$
 """
+import os
+import posixpath
+
+from time import time
+
 from zope.app.content_types import guess_content_type
 from zope.app.datetimeutils import rfc1123_date
-from time import time
-import os
 
+
 class File(object):
     
     def __init__(self, path):
@@ -29,7 +33,7 @@
         data = f.read()
         f.close()
         self.content_type, enc = guess_content_type(path, data)
-        self.__name__ = path[path.rfind('/') + 1:]
+        self.__name__ = posixpath.basename(path)
         self.lmt = float(os.stat(path)[8]) or time()
         self.lmh = rfc1123_date(self.lmt)
 



More information about the Zope3-Checkins mailing list