Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users

LocalFS

 

 

Zope users RSS feed   Index | Next | Previous | View Threaded


dieter at handshake

May 28, 2000, 2:32 PM

Post #1 of 22 (3157 views)
Permalink
LocalFS

Dear Jonothan,

thank you for LocalFS!

If you had not created it, I would have done it.
However, I must admit, mine would not have been as nice as yours.


I have attached a small patch that allows "Local File System"
and its content to be cataloged. There are still some open issues
I want to discuss in "zope-dev":
1. the addional meta types ("Local Directory" and "Local File")
which cannot be added as objects but should, maybe, cataloged.
2. "bobobase_modification_time", which is not completely
adaquate for cataloging local files.


Dieter

*************************************************************************
--- lib/python/Products/LocalFS/:LocalFS.py Fri Apr 14 06:36:06 2000
+++ lib/python/Products/LocalFS/LocalFS.py Sun May 28 22:12:40 2000
@@ -825,6 +825,15 @@
# deprecated methods, for backward compatibility
objectIds = fileIds
objectProps = fileValues
+
+ # to make LocalDirectory findable and catalogable
+ def objectItems(self):
+ # should we add a docstring? -- for webdav/XML-RPC
+ r= []
+ for i in self.fileIds():
+ try: r.append((i,self[i]))
+ except KeyError: pass
+ return r

def tpValues(self):
"""Returns a list of the folder's sub-folders, used by tree tag."""


andym at ActiveState

Feb 6, 2001, 9:49 AM

Post #2 of 22 (3090 views)
Permalink
Re: LocalFS [In reply to]

What error do you get?

--
Andy McKay.


----- Original Message -----
From: "Rubinstein Fredrik" <fredrik.rubinstein [at] ivf>
To: <zope [at] zope>
Sent: Tuesday, February 06, 2001 6:35 AM
Subject: [Zope] LocalFS


>
> Is there someone out there how has an working example
> of the call to "manage_upload" on an NT box.
> I get the localfs object to show the files on the server without
> problems.
>
> If I edit the localsf object, there is an upload function that also
> works like a dream
> but when I put an form in my DTML method and call the manage_upload
> function
> I get an Zope error. The code is as follows
>
> <FORM ACTION="manage_upload" METHOD="POST" ENCTYPE="multipart/form-data">
>
> <TABLE CELLSPACING="2">
> <TR>
> <TH ALIGN="LEFT" VALIGN="TOP">File</TH>
> <TD ALIGN="LEFT" VALIGN="TOP">
> <INPUT TYPE="file" NAME="file" SIZE="25" VALUE="">
> </TD>
> </TR>
> <TR>
> <TD></TD>
> <TD><BR><INPUT TYPE="SUBMIT" VALUE="Upload"></TD>
> </TR>
> </TABLE>
> </FORM>
>
>
> With kind regards
>
> Fred R.
>
>
>
> _______________________________________________
> Zope maillist - Zope [at] zope
> 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 )
>


kfarmer at thuban

Jan 14, 2002, 10:43 PM

Post #3 of 22 (3080 views)
Permalink
RE: LocalFS [In reply to]

Code is best when it's not a hack.

The normal default directory browsing mixes files and subdirectories.
While you can sort by type and id, this isn't a particularly enthralling
solution. For example, if you just want directories gathered at the top
of the list, but don't want files sorted any further than id.

Also, if you give a spec of '*.jpg', this will exclude directories
(which have a spec of '*/' or '*\').

Internally, LocalFS will place directories at the top, if they are
included in the spec. This, however, leads to boring and stupid urls
while browsing (always having to include '*/').

I could use tpValues(), but that doesn't deal with the spec, which
LocalFS appends internally to the url variable for directories (that it
adds this spec information without asking is a coding mistake, imho).

.. hmm.. perhaps I should remove that mistake, rewrite methodBrowse to
explicitly add spec as needed, and have done with it?

As I said.. code is best when it's not a hack. Code is best when it
allows modification without hackification.

----------
Keith J. Farmer
kfarmer [at] thuban
http://www.thuban.org


-----Original Message-----
From: John Ziniti [mailto:jziniti [at] speakeasy]
Sent: Tuesday, January 15, 2002 21:23

I mess around a lot with LocalFS .. but I'm not sure what you mean by
"direcotories
alwys at top ..." etc ...can you clarify a little bit about what you are

trying to do?


kfarmer at thuban

Jan 14, 2002, 11:05 PM

Post #4 of 22 (3081 views)
Permalink
RE: LocalFS [In reply to]

Sorting by type doesn't always place the directories at top (say you
have an object of type 'application/octet-stream'). Also, I don't want
the *files* to be sorted by type. They're all images -- whether jpg or
gif should be inconsequential.

So the real task is to display all the directories, and then display the
non-directories.

I've decided to use tpValues(), but have discovered it lacks some
variables otherwise provided by objectValues(). I'm working on
correcting that problem.

----------
Keith J. Farmer
kfarmer [at] thuban
http://www.thuban.org


jziniti at speakeasy

Jan 15, 2002, 10:22 PM

Post #5 of 22 (3081 views)
Permalink
Re: LocalFS [In reply to]

>
>
>Has anyone a good modification of LocalFS to allow an optional
>specification that puts directories silently at top, and always at top
>(that is, doesn't mess around with the spec variable)?
>
I mess around a lot with LocalFS .. but I'm not sure what you mean by
"direcotories
alwys at top ..." etc ...can you clarify a little bit about what you are
trying to do?

>
>I've hacked something, but it's kinda ugly since I didn't want to get
>too deep into the code.
>

:) that's what it's all about ...


jziniti at speakeasy

Jan 15, 2002, 10:52 PM

Post #6 of 22 (3074 views)
Permalink
Re: LocalFS [In reply to]

I understand now ...

I think sorting by type and __then__ by id is a normal thing to do. At
least,
it is something I expect to be able to do easily in the shell. I think
LocalFS,
which (IMO) is Zope's extension of "ls" should be able to do the same.

The Product is modifiable, if given sufficient foresight, and logical
default
values.


Keith J. Farmer wrote:

>Code is best when it's not a hack.
>
>The normal default directory browsing mixes files and subdirectories.
>While you can sort by type and id, this isn't a particularly enthralling
>solution. For example, if you just want directories gathered at the top
>of the list, but don't want files sorted any further than id.
>
>Also, if you give a spec of '*.jpg', this will exclude directories
>(which have a spec of '*/' or '*\').
>
>Internally, LocalFS will place directories at the top, if they are
>included in the spec. This, however, leads to boring and stupid urls
>while browsing (always having to include '*/').
>
>I could use tpValues(), but that doesn't deal with the spec, which
>LocalFS appends internally to the url variable for directories (that it
>adds this spec information without asking is a coding mistake, imho).
>
>.. hmm.. perhaps I should remove that mistake, rewrite methodBrowse to
>explicitly add spec as needed, and have done with it?
>
>As I said.. code is best when it's not a hack. Code is best when it
>allows modification without hackification.
>
>----------
>Keith J. Farmer
>kfarmer [at] thuban
>http://www.thuban.org
>
>
>-----Original Message-----
>From: John Ziniti [mailto:jziniti [at] speakeasy]
>Sent: Tuesday, January 15, 2002 21:23
>
>I mess around a lot with LocalFS .. but I'm not sure what you mean by
>"direcotories
>alwys at top ..." etc ...can you clarify a little bit about what you are
>
>trying to do?
>
>_______________________________________________
>Zope maillist - Zope [at] zope
>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 )
>
>


chrisw at nipltd

Mar 28, 2002, 5:58 AM

Post #7 of 22 (3100 views)
Permalink
Re: LocalFS [In reply to]

Roel Van den Bergh wrote:
>
> After installing LocalFS and restarting Zope I get an error about the
> python15.dll 'not found'.

Hmm... a shot in the dark:

Try deleting all the .pyc files on yoru system.

cheers,

Chris


roel at planetinterior

Mar 29, 2002, 2:03 AM

Post #8 of 22 (3098 views)
Permalink
RE: LocalFS [In reply to]

You're trying to kill me or what?
I would have to delete 1.756 files?

I did a text search on python15 and only two files came up:
[Zope]/bin/lib/disutils/cygwinccompiler.py and
[Zope]/lib/python/Products/LocalFS/win32wnet.pyd

If needed I can hack into the *.py file but I cannot edit the *.pyd file
directly.

Would it help if I just pasted the missing file in the wright spot? If so
can someone mail me this 'python15.dll'?

PS Please answer to zope [at] zope AND me, I'm not (yet) subscribed to the
mailinglist)

-----Oorspronkelijk bericht-----
Van: Chris Withers [mailto:chrisw [at] nipltd]
Verzonden: donderdag 28 maart 2002 13:59
Aan: roel [at] planetinterior
CC: zope [at] zope
Onderwerp: Re: [Zope] LocalFS


Roel Van den Bergh wrote:
>
> After installing LocalFS and restarting Zope I get an error about the
> python15.dll 'not found'.

Hmm... a shot in the dark:

Try deleting all the .pyc files on yoru system.

cheers,

Chris


lennart at torped

Mar 29, 2002, 2:19 AM

Post #9 of 22 (3078 views)
Permalink
Re: LocalFS [In reply to]

From: "Roel Van den Bergh" <roel [at] planetinterior>
> You're trying to kill me or what?
> I would have to delete 1.756 files?

Yes. Open the file search box in the explorer, search out all the pyc files
and delete them.

> Would it help if I just pasted the missing file in the wright spot? If so
> can someone mail me this 'python15.dll'?

What Zope version are you running? If you are running Zope up to v 2.3.3,
you already have this dll. You have to have it to run python, and hence
Zope. If you are running Zope 2.4.0 or later, it shouldn't ask for version
1.5 of python, but for 2.1.


roel at planetinterior

Mar 29, 2002, 2:56 AM

Post #10 of 22 (3085 views)
Permalink
RE: LocalFS [In reply to]

Running Zope 2.5.0 and CMF 1.2 under W2k and linux RH 7.2, no standalone
python
Tried to install LocalFS-0.10.1.tgz
Is there a newer version?


PS Please answer to zope [at] zope AND me, I'm not (yet) subscribed to the
zope mailinglist

-----Oorspronkelijk bericht-----
Van: Lennart Regebro [mailto:lennart [at] torped]
Verzonden: vrijdag 29 maart 2002 10:19
Aan: roel [at] planetinterior; zope [at] zope
Onderwerp: Re: [Zope] LocalFS


From: "Roel Van den Bergh" <roel [at] planetinterior>
> You're trying to kill me or what?
> I would have to delete 1.756 files?

Yes. Open the file search box in the explorer, search out all the pyc files
and delete them.

> Would it help if I just pasted the missing file in the wright spot? If so
> can someone mail me this 'python15.dll'?

What Zope version are you running? If you are running Zope up to v 2.3.3,
you already have this dll. You have to have it to run python, and hence
Zope. If you are running Zope 2.4.0 or later, it shouldn't ask for version
1.5 of python, but for 2.1.


lennart at torped

Mar 29, 2002, 3:12 AM

Post #11 of 22 (3095 views)
Permalink
Re: LocalFS [In reply to]

From: "Roel Van den Bergh" <roel [at] planetinterior>
> Running Zope 2.5.0 and CMF 1.2 under W2k and linux RH 7.2, no standalone
> python
> Tried to install LocalFS-0.10.1.tgz
> Is there a newer version?

I don't know. The point is that something in LocalFS is trying to call an
old python dll.
So the question the is: Have you deleted all the pyc files yet?


lennart at torped

Mar 29, 2002, 3:14 AM

Post #12 of 22 (3077 views)
Permalink
Re: LocalFS [In reply to]

Oh, and somewhere there has to be some c-code for that pyd file. It should
be recompiled for Python 2.1.2.

----- Original Message -----
From: "Roel Van den Bergh" <roel [at] planetinterior>
To: "Lennart Regebro" <lennart [at] torped>; <zope [at] zope>
Sent: Friday, March 29, 2002 10:56 AM
Subject: RE: [Zope] LocalFS


> Running Zope 2.5.0 and CMF 1.2 under W2k and linux RH 7.2, no standalone
> python
> Tried to install LocalFS-0.10.1.tgz
> Is there a newer version?
>
>
> PS Please answer to zope [at] zope AND me, I'm not (yet) subscribed to the
> zope mailinglist
>
> -----Oorspronkelijk bericht-----
> Van: Lennart Regebro [mailto:lennart [at] torped]
> Verzonden: vrijdag 29 maart 2002 10:19
> Aan: roel [at] planetinterior; zope [at] zope
> Onderwerp: Re: [Zope] LocalFS
>
>
> From: "Roel Van den Bergh" <roel [at] planetinterior>
> > You're trying to kill me or what?
> > I would have to delete 1.756 files?
>
> Yes. Open the file search box in the explorer, search out all the pyc
files
> and delete them.
>
> > Would it help if I just pasted the missing file in the wright spot? If
so
> > can someone mail me this 'python15.dll'?
>
> What Zope version are you running? If you are running Zope up to v 2.3.3,
> you already have this dll. You have to have it to run python, and hence
> Zope. If you are running Zope 2.4.0 or later, it shouldn't ask for version
> 1.5 of python, but for 2.1.
>
>
>
>
>
>


roel at planetinterior

Mar 29, 2002, 3:32 AM

Post #13 of 22 (3078 views)
Permalink
RE: LocalFS [In reply to]

Ain't I gonna f**k up my Zope and all the products I added deleting all
these files?

-----Oorspronkelijk bericht-----
Van: Lennart Regebro [mailto:lennart [at] torped]
Verzonden: vrijdag 29 maart 2002 11:13
Aan: roel [at] planetinterior; zope [at] zope
Onderwerp: Re: [Zope] LocalFS


From: "Roel Van den Bergh" <roel [at] planetinterior>
> Running Zope 2.5.0 and CMF 1.2 under W2k and linux RH 7.2, no standalone
> python
> Tried to install LocalFS-0.10.1.tgz
> Is there a newer version?

I don't know. The point is that something in LocalFS is trying to call an
old python dll.
So the question the is: Have you deleted all the pyc files yet?


chrisw at nipltd

Mar 29, 2002, 3:50 AM

Post #14 of 22 (3081 views)
Permalink
Re: LocalFS [In reply to]

Roel Van den Bergh wrote:
>
> [Zope]/lib/python/Products/LocalFS/win32wnet.pyd

Hurm :-S

I wasn't aware that LocalFS had binary bits...

...you'll need to get hold of Jon Farr and persuade him to recompile
win32wnet.pyd for Python 2.1.2, or whatever version of python you're using...

cheers,

Chris

PS:
> PS Please answer to zope [at] zope AND me, I'm not (yet) subscribed to the
> mailinglist)

...some would see that request as pretty rude, join the mailing list if you want
help from it!


nico at tekNico

Mar 29, 2002, 4:35 AM

Post #15 of 22 (3089 views)
Permalink
Re: LocalFS [In reply to]

> ...you'll need to get hold of Jon Farr and persuade him to recompile
> win32wnet.pyd for Python 2.1.2, or whatever version of python you're using...

That won't be easy. LocalFS is fundamentally orphaned. :^( Jon's words:

"I keep hoping that someone who actually uses the product might step up and
take over organizing it. ... I have a hard time motivating myself to
maintain a product I don't even use."

http://lists.zope.org/pipermail/zope-announce/2002-March/000745.html


Oh, and anyone subscribing to this and not to ZopeAnnounce is a moron. ;^)))


--
Two witches watch two watches. Which witch watched which watch?

Nicola Larosa - nico [at] tekNico


roel at planetinterior

Apr 3, 2002, 5:34 AM

Post #16 of 22 (3076 views)
Permalink
RE: LocalFS [In reply to]

Done it (finally), I deleted all *.pyc files
Still no changes

python.exe is still trying to access python15.dll in the LocalFS folder
although I'm running Zope 2.5.0

-----Oorspronkelijk bericht-----
Van: Lennart Regebro [mailto:lennart [at] torped]
Verzonden: vrijdag 29 maart 2002 11:32
Aan: roel [at] planetinterior
Onderwerp: Re: [Zope] LocalFS


No.
----- Original Message -----
From: "Roel Van den Bergh" <roel [at] planetinterior>
To: "Lennart Regebro" <lennart [at] torped>; <zope [at] zope>
Sent: Friday, March 29, 2002 11:32 AM
Subject: RE: [Zope] LocalFS


> Ain't I gonna f**k up my Zope and all the products I added deleting all
> these files?
>
> -----Oorspronkelijk bericht-----
> Van: Lennart Regebro [mailto:lennart [at] torped]
> Verzonden: vrijdag 29 maart 2002 11:13
> Aan: roel [at] planetinterior; zope [at] zope
> Onderwerp: Re: [Zope] LocalFS
>
>
> From: "Roel Van den Bergh" <roel [at] planetinterior>
> > Running Zope 2.5.0 and CMF 1.2 under W2k and linux RH 7.2, no standalone
> > python
> > Tried to install LocalFS-0.10.1.tgz
> > Is there a newer version?
>
> I don't know. The point is that something in LocalFS is trying to call an
> old python dll.
> So the question the is: Have you deleted all the pyc files yet?
>
>
>
>


pw_lists at slinkp

Dec 11, 2002, 8:59 AM

Post #17 of 22 (3082 views)
Permalink
Re: localfs [In reply to]

On Wed, Dec 11, 2002 at 10:56:12AM +0100, Coanda, Mihai wrote:
> How can I find the name and the path of the filex?

Did you not get the answer I already posted to this list?

name: filex.filename
path: if you mean the path it came from on the filesystem, you can't.


--

Paul Winkler
http://www.slinkp.com
"Welcome to Muppet Labs, where the future is made - today!"


tpassin at mitretek

Apr 30, 2003, 10:14 AM

Post #18 of 22 (3080 views)
Permalink
RE: localFS [In reply to]

[ Jianping Zhu]
>
> where can I find information or documentation about how to install
> localFS?
>
[Ahem] Search Google for "localfs", the very first hit I got just now is
what you want.

Cheers,

Tom P


webmaven at cox

Dec 8, 2003, 2:03 PM

Post #19 of 22 (3083 views)
Permalink
Re: LocalFS [In reply to]

Dilley, Hara wrote:

> [...] to get the images I have a dtml method with the code: <dtml-in
> expr="myImages.objectValues('Image')"> That code returns the error
> that objectValues has not been defined. Can I do this with LocalFS?
> and can I treat a localFs object just as another zope folder?

Googling a bit brings up this Howto:
http://www.zope.org/Members/jfarr/HowTo/DTML_with_LocalFS

- Michael Bernstein


_______________________________________________
Zope maillist - Zope [at] zope
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


dieter at handshake

Dec 9, 2003, 11:57 AM

Post #20 of 22 (3084 views)
Permalink
Re: LocalFS [In reply to]

Dilley, Hara wrote at 2003-12-8 09:39 -0800:
>I have a directory on a network drive with employees images. I like to produce a page with everyone's picture that I can click on and get more information on that employee. I am using LocalFS to be able to see the directory that contains the images, I am naming the Local Filesystem object "myImages". In order to get the images I have a dtml method with the code: <dtml-in expr="myImages.objectValues('Image')">
>That code returns the error that objectValues has not been defined. Can I do this with LocalFS? and can I treat a localFs object just as another zope folder?

I thinks, "LocalFS" has a different set of "*{Ids|Values|Items}" methods
("fileValues"?).

--
Dieter

_______________________________________________
Zope maillist - Zope [at] zope
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


casey at zope

Jan 23, 2004, 7:10 AM

Post #21 of 22 (3086 views)
Permalink
Re: LocalFS [In reply to]

On Fri, 23 Jan 2004 00:16:30 -0000
"David Kyte" <dave [at] microamps> wrote:
[..]
> LocalFS appears to have a bug
>
> When I use manage_addFile within LocalFS the File is created
> in the Parent directory. Any work arounds or fixes or am I missing
> something
>
> Python script:
>
> context.EG.manage_addFile( "eg", "eg" )

This assumes that EG (which I assume is a LocalFS object, right?) has a
"manage_addFile" method. If it doesn't it will get acquired from the
context (probably the folder above in your case) and the file gets
created there.

Does LocalFS support adding files from the Zope side? Perhaps it has its
own API different from manage_addFile?

If it doesn't, you could just write a simple external method which
created the file in the proper place directly. Something like:

import os.path

def writeFile(filename, data):
open(os.path.join('/path/to/localfs/dir', filename),
'wb').write(data)

Obviously you'd want to make sure you secure the external method so it
is not directly callable through the web by everyone.

> Any help would be appreciated
>
> IS APE ready for production use?

Dunno, I've not used it yet.

-Casey

_______________________________________________
Zope maillist - Zope [at] zope
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


chris at simplistix

Apr 11, 2009, 3:30 AM

Post #22 of 22 (3075 views)
Permalink
Re: LocalFS [In reply to]

Jürgen Herrmann wrote:
> - localfs, as discussed which needed a few minor tweaks to keep it
> running. i did them myself, primarily because i wanted to keep
> going on immediately and i didn't want to look or even wait for
> a fixed version. it wasn't rocket science to make those corrections
> to the code, so no maintenance nightmare in sight here.

Given that so many of you seem to be doing this, why not one of you
actually pick up the patches, apply them, release a version and maintain
it until you no longer need LocalFS?

All this independent patching seems a little insane...

Chris

--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
_______________________________________________
Zope maillist - Zope [at] zope
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Zope users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.