I "thought" LocalFS worked. But now when I import something with a LocalFS defined or attempt to create a new one here's the traceback on: Zope Version Zope 2.3.0 (binary release, python 1.5.2, linux2-x86) Python Version 1.5.2 (#10, Dec 6 1999, 12:16:27) [GCC 2.7.2.3] System Platform linux2 Error Type: AttributeError Error Value: _local_path Traceback (innermost last): File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/zope/2.3/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/zope/2.3/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_main) File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_main) File /usr/local/zope/2.3/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__ (Object: manage_main) File /usr/local/zope/2.3/lib/python/Shared/DC/Scripts/Bindings.py, line 353, in _bindAndExec (Object: manage_main) File /usr/local/zope/2.3/lib/python/App/special_dtml.py, line 236, in _exec (Object: manage_main) File /usr/local/zope/2.3/lib/python/DocumentTemplate/DT_In.py, line 711, in renderwob (Object: objectItems) File /usr/local/zope/2.3/lib/python/DocumentTemplate/DT_With.py, line 146, in render (Object: sequence-key) File /usr/local/zope/2.3/lib/python/DocumentTemplate/DT_Var.py, line 271, in render (Object: bobobase_modification_time) File /usr/local/zope/2.3/lib/python/Products/LocalFS/LocalFS.py, line 979, in bobobase_modification_time (Object: myhomedir) AttributeError: (see above) -- Tim Cook, President -- Free Practice Management,Inc. | http://www.FreePM.com Office: (901) 884-4126 "Liberty has never come from the government." - Woodrow Wilson
I patched mine quickly: --- d:\Zope23\lib\python\Products\LocalFS\LocalFS.py Mon Jan 29 13:57:00 2001 +++ d:\lib\python\Products\LocalFS\LocalFS.py Thu Oct 19 06:42:20 2000 @@ -270,8 +270,7 @@ _local_path = None def bobobase_modification_time(self): - try: t = os.stat(self._local_path)[stat.ST_MTIME] - except: t = time.time() + t = os.stat(self._local_path)[stat.ST_MTIME] return DateTime(t) def __repr__(self): @@ -977,8 +976,7 @@ except 'Forbidden': pass def bobobase_modification_time(self): - try: t = os.stat(self._local_path)[stat.ST_MTIME] - except: t = time.time() + t = os.stat(self._local_path)[stat.ST_MTIME] return DateTime(t) class LocalFile( However this is just a quick works for me hack. -- Andy McKay. ----- Original Message ----- From: "Tim Cook" <twcook@iswt.com> To: <zope@zope.org> Sent: Monday, January 29, 2001 1:08 PM Subject: [Zope] LocalFS on 2.3.0
I "thought" LocalFS worked. But now when I import something with a LocalFS defined or attempt to create a new one here's the traceback on:
Zope Version Zope 2.3.0 (binary release, python 1.5.2, linux2-x86) Python Version 1.5.2 (#10, Dec 6 1999, 12:16:27) [GCC 2.7.2.3] System Platform linux2
Error Type: AttributeError Error Value: _local_path
Traceback (innermost last): File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/zope/2.3/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/zope/2.3/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_main) File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_main) File /usr/local/zope/2.3/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__ (Object: manage_main) File /usr/local/zope/2.3/lib/python/Shared/DC/Scripts/Bindings.py, line 353, in _bindAndExec (Object: manage_main) File /usr/local/zope/2.3/lib/python/App/special_dtml.py, line 236, in _exec (Object: manage_main) File /usr/local/zope/2.3/lib/python/DocumentTemplate/DT_In.py, line 711, in renderwob (Object: objectItems) File /usr/local/zope/2.3/lib/python/DocumentTemplate/DT_With.py, line 146, in render (Object: sequence-key) File /usr/local/zope/2.3/lib/python/DocumentTemplate/DT_Var.py, line 271, in render (Object: bobobase_modification_time) File /usr/local/zope/2.3/lib/python/Products/LocalFS/LocalFS.py, line 979, in bobobase_modification_time (Object: myhomedir) AttributeError: (see above)
-- Tim Cook, President -- Free Practice Management,Inc. | http://www.FreePM.com Office: (901) 884-4126 "Liberty has never come from the government." - Woodrow Wilson
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
That patch helped me out. Thanks. Kind of unusual, though, for the patch file to _remove_ the fix. ;-) -- 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
I submitted the following patch to the LocalFS maintainer not too long ago. LocalDirectory objects don't have _local_path set, so bobobase_modification_time() barfs when the new management interface tries to display the mod time. --- LocalFS.py-dist Wed Jan 17 14:27:45 2001 +++ LocalFS.py Wed Jan 17 14:33:21 2001 @@ -976,6 +976,8 @@ except 'Forbidden': pass def bobobase_modification_time(self): + if not hasattr(self, '_local_path'): + self._local_path = self.basepath t = os.stat(self._local_path)[stat.ST_MTIME] return DateTime(t) @@ -1179,7 +1181,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
Ah I think my patch was the wrong way around... but you get the idea :) -- Andy McKay. ----- Original Message ----- From: "Andy McKay" <andym@ActiveState.com> To: <tim@freepm.org>; <zope@zope.org> Sent: Monday, January 29, 2001 2:05 PM Subject: Re: [Zope] LocalFS on 2.3.0
I patched mine quickly:
--- d:\Zope23\lib\python\Products\LocalFS\LocalFS.py Mon Jan 29 13:57:00 2001
+++ d:\lib\python\Products\LocalFS\LocalFS.py Thu Oct 19 06:42:20 2000 @@ -270,8 +270,7 @@ _local_path = None
def bobobase_modification_time(self): - try: t = os.stat(self._local_path)[stat.ST_MTIME] - except: t = time.time() + t = os.stat(self._local_path)[stat.ST_MTIME] return DateTime(t)
def __repr__(self): @@ -977,8 +976,7 @@ except 'Forbidden': pass
def bobobase_modification_time(self): - try: t = os.stat(self._local_path)[stat.ST_MTIME] - except: t = time.time() + t = os.stat(self._local_path)[stat.ST_MTIME] return DateTime(t)
class LocalFile(
However this is just a quick works for me hack. -- Andy McKay.
----- Original Message ----- From: "Tim Cook" <twcook@iswt.com> To: <zope@zope.org> Sent: Monday, January 29, 2001 1:08 PM Subject: [Zope] LocalFS on 2.3.0
I "thought" LocalFS worked. But now when I import something with a LocalFS defined or attempt to create a new one here's the traceback on:
Zope Version Zope 2.3.0 (binary release, python 1.5.2, linux2-x86) Python Version 1.5.2 (#10, Dec 6 1999, 12:16:27) [GCC 2.7.2.3] System Platform linux2
Error Type: AttributeError Error Value: _local_path
Traceback (innermost last): File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/zope/2.3/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/zope/2.3/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_main) File /usr/local/zope/2.3/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_main) File /usr/local/zope/2.3/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__ (Object: manage_main) File /usr/local/zope/2.3/lib/python/Shared/DC/Scripts/Bindings.py, line 353, in _bindAndExec (Object: manage_main) File /usr/local/zope/2.3/lib/python/App/special_dtml.py, line 236, in _exec (Object: manage_main) File /usr/local/zope/2.3/lib/python/DocumentTemplate/DT_In.py, line 711, in renderwob (Object: objectItems) File /usr/local/zope/2.3/lib/python/DocumentTemplate/DT_With.py, line 146, in render (Object: sequence-key) File /usr/local/zope/2.3/lib/python/DocumentTemplate/DT_Var.py, line 271, in render (Object: bobobase_modification_time) File /usr/local/zope/2.3/lib/python/Products/LocalFS/LocalFS.py, line 979, in bobobase_modification_time (Object: myhomedir) AttributeError: (see above)
-- Tim Cook, President -- Free Practice Management,Inc. | http://www.FreePM.com Office: (901) 884-4126 "Liberty has never come from the government." - Woodrow Wilson
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (4)
-
Andy McKay -
Fred Yankowski -
Ron Bickers -
Tim Cook