# HG changeset patch # User Sylvain Thénault # Date 1271752685 -7200 # Node ID c3a037550e1f16917ff75b20f3d3785de680dc1e # Parent 7bf2d66418aff9ef2d429950e4888282673d002c [etwist] proper getChild implementation (eventually): fix fckeditor resources locating bugs by properly using file resources diff -r 7bf2d66418af -r c3a037550e1f etwist/server.py --- a/etwist/server.py Tue Apr 20 10:00:55 2010 +0200 +++ b/etwist/server.py Tue Apr 20 10:38:05 2010 +0200 @@ -170,21 +170,25 @@ # Anything in data/, static/, fckeditor/ and the generated versioned # data directory is treated as static files if directory in self.static_directories: + # take care fckeditor may appears as root directory or as a data + # subdirectory + if directory == 'static': + return File(self.config.static_directory) + if directory == 'fckeditor': + return File(self.config.ext_resources['FCKEDITOR_PATH']) + if directory != 'data': + # versioned directory, use specific file with http cache + # headers so their are cached for a very long time + cls = LongTimeExpiringFile + else: + cls = File + if path == 'fckeditor': + return cls(self.config.ext_resources['FCKEDITOR_PATH']) if path == directory: # recurse return self - cls = File - if directory == 'static': - datadir = self.config.static_directory - elif directory == 'fckeditor': - datadir = self.config.ext_resources['FCKEDITOR_PATH'] - else: - datadir = self.config.locate_resource(path) - if datadir is None: - return self - if directory != 'data': - # versioned directory, use specific file with http cache - # headers so their are cached for a very long time - cls = LongTimeExpiringFile + datadir = self.config.locate_resource(path) + if datadir is None: + return self # recurse self.debug('static file %s from %s', path, datadir) return cls(join(datadir, path)) # Otherwise we use this single resource