[Zope-dev] Product Access to Files

zope-dev at netchan.cotse.net zope-dev at netchan.cotse.net
Tue Mar 9 13:19:55 EST 2004


I serve static content with FileSystemSite
(http://www.zope.org/Members/k_vertigo/Products/FileSystemSite).

Sandor

> -----Original Message-----
> From: zope-dev-bounces at zope.org 
> [mailto:zope-dev-bounces at zope.org] On Behalf Of Ian Beatty
> Sent: Tuesday, March 09, 2004 12:13 PM
> To: zope-dev at zope.org
> Subject: [Zope-dev] Product Access to Files
> 
> 
> Greetings.
> 
> I'm developing a Python-based product that needs to serve up 
> a variety of XML files out of the product's directory. That 
> is, certain URLs handled by instances of a product-defined 
> type need to return an XML file that's on disk along with the 
> product's DTML views and the like. Let's say that the URL
> 
    http://localhost/foo/bar

resolves to an object my product class defines. Then I'd like

    http://localhst/foo/bar/static/a

to serve a file named 'a' in a directory named 'xml_files' in my
product's directory. Similarly,

    http://localhst/foo/bar/static/b/c

should serve a file named 'c' within a directory named 'b' within
'xml_files' in my product's directory.

I'd rather not hard-code every single file in the Python module, since
there will be many, and they'll be changing a lot during development.

I've been messing around with DTMLFile and ClassicHTMLFile and the like,
haven't been able to figure out how to get it to work for arbitrary
paths. They also require all my file names end in '.dtml', which is
quite a pain.

Any suggestions?

Thanks,

..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/
-- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- --



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




More information about the Zope-Dev mailing list