[Zope-dev] Product Access to Files

Ian Beatty beatty at physics.umass.edu
Thu Mar 11 09:01:13 EST 2004


On 2004-03-11 7:04 AM, Chris Withers is reputed to have said:

>> I'm overriding '__getitem__' and using Python's "os" package to directly
>> access the local file system. I just sniff the file name extension and set
>> the response content-type, then return the contents of the named file.
>> Simple and stupid.
> 
> Ooo... I hope you're confident in what you're doing :-S

Not in the least! =8-0 I've never mucked around this deep within Zope
before. What's the danger... threading issues?

> Should be vaguely okay, provided you're not writing to those files with the
> os module.

No writing, only reading.

> Mindyou, Apache could serve 'em a LOT faster...

It's a whole lot easier to have those files nicely packaged inside my
product, so that all someone needs to do is install the product and be done
with it. No separate directory of files to put somewhere, no Apache
configuration to do, no URL issues.

I'm wide open to suggestions for a better way to do this!

>> (If anyone's curious, I'm using a Zope product for a back-end to a
>> Mozilla/XUL front-end. This static file stuff allows the product to provide
>> the XUL, JavaScript, and CSS files needed to define the Mozilla-based
>> interface.)
> 
> Cool :-)

I think so! ;-P

In the long run, I may set up the XUL/etc. to be installed into the user's
Mozilla "Chrome", and then it would be permanently resident. So it would
only be downloaded once per user, which makes efficiency less important and
Apache (hopefully) unnecessary.

Cheers,

..Ian

-- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- --
Dr. Ian Beatty                           beatty at physics.umass.edu
Physics Education Research Group              voice: 413.545.9483
Department of Physics                           fax: 413.545.4884
Univ. of Massachusetts              AIM: (available upon request)
Amherst, MA 01003-4525 USA       http://umperg.physics.umass.edu/
-- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- --





More information about the Zope-Dev mailing list