[Zope] Problem with LocalFS (_local_path)

Fred Yankowski fred@ontosys.com
Wed, 31 Jan 2001 07:16:52 -0600


On Wed, Jan 31, 2001 at 01:05:28PM +0100, Oliver Frommel wrote:
> I am trying to install LocalFS 0.9.6 on Zope 2.3.0 and get the following
> error:
> 
> Error Type: AttributeError
> Error Value: _local_path

LocalFS needs several patches for Zope 2.3.0.  I've attached a patch
script that shows what I've had to do so far.  Others created the
original patches -- I'm just passing on what I learned.  LocalFS is
working OK for me now, AFAICT.

-- 
Fred Yankowski           fred@OntoSys.com      tel: +1.630.879.1312
Principal Consultant     www.OntoSys.com       fax: +1.630.879.1370
OntoSys, Inc             38W242 Deerpath Rd, Batavia, IL 60510, USA

--

--- LocalFS.py.orig	Thu Oct 19 02:42:20 2000
+++ LocalFS.py		Mon Jan 29 17:49:57 2001
@@ -270,7 +270,10 @@
     _local_path = None
 
     def bobobase_modification_time(self):
-        t = os.stat(self._local_path)[stat.ST_MTIME]
+        if not hasattr(self, '_local_path'):
+            self._local_path = self.basepath
+        try: t = os.stat(self._local_path)[stat.ST_MTIME]
+	 except: t = time.time()
         return DateTime(t)
 
     def __repr__(self):
@@ -976,7 +979,8 @@
                 except 'Forbidden': pass
                 
     def bobobase_modification_time(self):
-        t = os.stat(self._local_path)[stat.ST_MTIME]
+        try: t = os.stat(self._local_path)[stat.ST_MTIME]
+	 except: t = time.time()
         return DateTime(t)
         
 class LocalFile(
@@ -1179,7 +1183,7 @@
         """Change the properties of the file system object."""
 
         self.title = title
-        self.basepath = os.path.normpath(basepath)
+        self.basepath = self._local_path = os.path.normpath(basepath)
         self.default_document = default_document or self.default_document
         self.tree_view = self.isPrincipiaFolderish = tree_view
         self.catalog = catalog