[Zope] DirectoryStorage product - zope won't start

Thomas Bennett bennetttm at appstate.edu
Fri Sep 12 10:12:34 EDT 2008


Thank you Dieter,  I've found that DirectoryStorage is not what I was looking 
for.  I didn't realize that DS was something more like an file system version 
of Data.fs.

Trying to install LocalFS it is missing two files, see below, and this is what 
happens with LocalFS and the updated LocalFS called StreamingFS.

  I wanted something more like the LocalFS product but it fails not finding 
content_types and then after adding content_types.py from Zope 2.6.1 it can't 
find ts_regex.  I see that content_types just uses re and mimetypes so I 
didn't think there would be any harm adding it from an older version of Zope 
to this one.  I added ts_regex.py from the 2.6.1 Zope and I can add a LocalFS 
object but opening it I get "Resource not found" and no errors on the 
terminal running zopectl fg.

Although when starting Zope I get 

/opt/zope/lib/python/ts_regex.py:15: DeprecationWarning: the regex module is 
deprecated; please use the re module
  import regex, regsub #, Sync
/usr/local/lib/python2.4/regsub.py:15: DeprecationWarning: the regsub module 
is deprecated; please use re.sub()
  DeprecationWarning)
/opt/zope/lib/python/OFS/Application.py:809: DeprecationWarning: __init__.py 
of Products.ExternalFile has a long deprecated 'methods' attribute. 'methods' 
support might be removed in Zope 2.11 or a later feature release. Please use 
the 'legacy' argument of registerClass instead if the methods are 
constructors. Or refactor the product using adapters.
  DeprecationWarning)


But I'm not sure what is involved in refactoring or registerClass and don't 
know if that will allow LocalFS to operate properly if that is done.  I 
assume filesystemview doesn't work with Zope alone, right?

I have moved away from the ExternalFile product because using the batch method 
does not update files in secondary folders, just the current folder and there 
are too many secondary folders to have to update each one individually.  

So, to anyone, is there a Product that works that will allow transparent 
access to files on the filesystem through zope, like LocalFS?



Thomas



On Wednesday 10 September 2008 13:36, Dieter Maurer wrote:
> Thomas Bennett wrote at 2008-9-9 13:12 -0400:
> >using
> >python 2.4.5
> >Zope 2.11.1-final
> >DirectoryStorage 1.1.19
> >
> >
> >First, is there a more preferable product to use to serve files, mostly
> > PDF, from the file system with Zope?
> >
> >I suspect lock_file.py has changed since the DirectoryStorage product was
> > last updated.
> >
> >I followed instructions on http://dirstorage.sourceforge.net/install.html
> > to install DirectoryStorage.  I got to step 11. "Start Zope" and at the
> > end of Traceback 1 (see below)
> >  File
> > "/usr/local/lib/python2.4/site-packages/DirectoryStorage/PosixFilesystem.
> >py", line 12, in ? from ZODB.lock_file import lock_file
> >ImportError: cannot import name lock_file
> >
> >There are no classes or methods named lock_file in lock_file.py so I
> > changed the import statement in PosixFilesystem.py to from ZODB import
> > lock_file
>
> The interface changed a bit.
>
> Now, it is assumed that "LockFile" is used (and "close" to release the
> lock).
>
> It is probably very simple to adapt "DirectoryStorage" correspondingly.

-- 
====================================================================
Thomas McMillan Grant Bennett		Appalachian State University
Operations & Systems Analyst		P O Box 32026
University Library			Boone, North Carolina 28608
(828) 262 6587

"... using OpenOffice.org, and save them back to disk automatically,
in MS Word format.  They surf the Web, check e-mail, do instant 
messaging, view YouTube videos, visit their Facebook pages, learn 
touch-typing skills and lots more.  Our public library has been 
offering these Linux public stations for the past three years."
 - Phil Shapiro Linux Journal January 2008

Library Systems Help Desk: https://www.library.appstate.edu/help/
====================================================================


More information about the Zope mailing list