Re: [Zope] LocalFS question
> At least the "Local File System" object does not expose > its children via "getattr" (which is required for the > usual "." operator to work) but only via "[...]". > > This probably is a bug. No this is by design, as explained in the how-to. Most operating systems allow period (.) characters in filenames, so how would the dtml expression "LocalFS.some.dir.some.file.plus.extension" be translated to a file system path? --jfarr ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] LocalFS question
Leichtman, David J writes: > However, if you try to do the same thing with a LocalFS object, i.e. > , > you get the error NameError: localfs_subobject > This leads me to believe that LocalFS subobjects are not really objects. But > then how does the Zope management interface deal with them, and how can I? They are real objects but they behave differently from the standard Zope objects. You can use At least the "Local File System" object does not expose its children via "getattr" (which is required for the usual "." operator to work) but only via "[...]". This probably is a bug. Dieter ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] LocalFS question
On Mon, 11 Dec 2000, Leichtman, David J wrote: > How do you access an individual object in a LocalFS? By that, I mean: [...] > , > you get the error NameError: localfs_subobject 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 )
Re: [Zope] LocalFS question
See the how-to: http://www.zope.org/Members/jfarr/Products/LocalFS/HowTo/DTML_with_LocalFS --jfarr - Original Message - From: "Leichtman, David J" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 11, 2000 2:54 PM Subject: [Zope] LocalFS question > > How do you access an individual object in a LocalFS? By that, I mean: > > If I wanted the last_mod time of any Zope object, I could say "object.subobject.bobobase_modification_time">. > However, if you try to do the same thing with a LocalFS object, i.e. > , > you get the error NameError: localfs_subobject > This leads me to believe that LocalFS subobjects are not really objects. But > then how does the Zope management interface deal with them, and how can I? > > ___ > Zope maillist - [EMAIL PROTECTED] > 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 - [EMAIL PROTECTED] 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 )
Re: [Zope] LocalFS question
They are real objects, just in a different sense. The easiest way to figure it out is too look at the dtml that comes in the LocalFS source. For example to get a listing of LocalFS folder instead of: objectIds() try fileItems() -- Andy McKay, Developer. ActiveState. - Original Message - From: "Leichtman, David J" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 11, 2000 2:54 PM Subject: [Zope] LocalFS question How do you access an individual object in a LocalFS? By that, I mean: If I wanted the last_mod time of any Zope object, I could say . However, if you try to do the same thing with a LocalFS object, i.e. , you get the error NameError: localfs_subobject This leads me to believe that LocalFS subobjects are not really objects. But then how does the Zope management interface deal with them, and how can I? ___ Zope maillist - [EMAIL PROTECTED] 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 - [EMAIL PROTECTED] 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] LocalFS question
How do you access an individual object in a LocalFS? By that, I mean: If I wanted the last_mod time of any Zope object, I could say . However, if you try to do the same thing with a LocalFS object, i.e. , you get the error NameError: localfs_subobject This leads me to believe that LocalFS subobjects are not really objects. But then how does the Zope management interface deal with them, and how can I? ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] LocalFS Question
Jim Sanford <[EMAIL PROTECTED]> wrote: > > Does anyone out there know how I can prevent LocalFS from > translating CR/LF pairs in a text file to LFs when serving up > the file? > > Or will I need to "massage" it in Zope before sending it? > > In this case the files are Windows/DOS batch files. > > They will not run with the CR/LFs replaced with LFs. Assuming that the files are truly stored with the CRLF endings (as distinct from Jonothan Farr's hypothesis that they have all been canonicalized to end in LF), you need to get LocalFS to 'open()' the batch files in binary mode, e.g., if string.lower( filename[:-4] ) == '.bat': return open( filename, 'b' ) else: return open( filename ) Tres. -- = Tres Seaver [EMAIL PROTECTED] Digital Creations "Zope Dealers" http://www.zope.org ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] LocalFS Question
> Does anyone out there know how I can prevent LocalFS from translating CR/LF > pairs in a text file to LFs when serving up the file? > > Or will I need to "massage" it in Zope before sending it? > > In this case the files are Windows/DOS batch files. It sounds like the files have unix endlines on the server and are being served as binary files. If you set the mime type to text/plain they will get converted to dos endlines when served to a windows machine. You can use the 'type map' property to map the .bat extension to text/plain. --jfarr "Perl is worse than Python because people wanted it worse." Larry Wall, 14 Oct 1998 ___ Zope maillist - [EMAIL PROTECTED] 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] LocalFS Question
Does anyone out there know how I can prevent LocalFS from translating CR/LF pairs in a text file to LFs when serving up the file? Or will I need to "massage" it in Zope before sending it? In this case the files are Windows/DOS batch files. They will not run with the CR/LFs replaced with LFs. Jim Sanford ___ Zope maillist - [EMAIL PROTECTED] 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 )