I'm pleased to see that the latest beta contains the code I submitted for
dealing with static files. I've been away and so have only just caught up
with the recent discussion concerning that. Here are some of my thoughts.
I understand why the CGIScript class would be regarded as evil :-). I agree
that in general Quixote shouldn't being aiming to support the deployment of
CGI scripts. Instead the motivation behind CGIScript was to provide a
stepping stone in migrating a CGI application to Quixote; the scripts
comprising the CGI application could first be wrapped as CGIScript objects
and then each in turn converted to a function. But I understand if it's
thought this facility comes at too high a cost.
I'm OK with renaming StaticFilesFolder to StaticDirectory and with dropping
caching for the contents of a StaticFile. There are a few places in the
commentary that then need to be changed. I've attached a patch file.
Cheers,
Hamish
Compare: (<)E:\quixote\util.orig.py (7038 bytes)
with: (>)E:\quixote\util.py (7046 bytes)
103c103
< Wrap a filesystem folder containing static files as a Quixote namespace.
---
> Wrap a filesystem directory containing static files as a Quixote
namespace.
113c113
< If 'use_cache' is true, the file's content will be cached in memory.
---
> If 'use_cache' is true, StaticFile instances will be cached in
memory.
155c155
< Get a file from the filesystem folder and return the StaticFile
---
> Get a file from the filesystem directory and return the StaticFile