Here's a patch to implement ExtensionsToServe, FilesToHide, and
FilesToServe. They work as I documented yesterday, and will also need
to be added to the default config file.
IMHO,there's far too much coupling in there between the Application
and Request classes, which makes it harder than it should be to grok, or
implement new stuff like this.
On Thursday 13 December 2001 11:59, Geoffrey Talvola wrote:
> 2 questions:
> - Can this be made backward-compatible by also allowing the name
> "ExtensionsToIgnore", perhaps emitting a deprecation warning
> - Now that you've done the work in your experimental version, could
> you adapt it to create a patch for Webware CVS?
> At 01:40 PM 12/12/01 -0800, Tavis Rudd wrote:
> >I've just done a little more work on this in the experimental
> > code. Here are the config settings I've implemented and tested so
> > far:
> >DirectoryFiles = ['index','Index','main','Main',
> > 'default','Default',]
> >## these 2 only affect requests with no extension specified
> ># same as before
> >ExtensionsToHide = ['.pyc','.pyo','.py~', '.bak', '.tmpl',
> > '.py_bak'] # only use if a list is given
> >ExtensionsToServe = None
> ># ExtensionsToServe = ['.py','.html']
> ># if multiple files are found for a URI without the ext specified
> ># cascade through this list in sequence till one is found.
> ># 404 if none match
> >UseCascadingExtensions = True
> >ExtensionCascadeOrder = ['.html', '.py', '.psp', '.tmpl']
> ># a list of glob patterns to filter out after all the rest of the
> ># path matching is finished. 404 if matches
> >FilesToHide = ['.*','*~', '*bak', '*.tmpl', ]
> ># a list glob patterns to serve from exclusively.
> ># if the file found for the URI doesn't match then 404
> ># done after FilesToHide
> >FilesToServe = None # only used if a list is given
> >#FilesToServe = ['*.py', '*.jpg','*.gif']
> >Regardless of whether the rest of the experimental code is used I
> >feel this stuff should definitely make it in. What do you think
> > about the names I've given the settings? ExtensionsToServe and
> > FilesToServe are a bit ambiguous. I'm leaning towards