# HG changeset patch # User Jeff Hammel # Date 1277962439 25200 # Node ID 8ba2f10878808c4d4c935564c66853434949e2ef # Parent 89f7a8ca965c2284721c05895c9bb82f5e9a7ad8# Parent 677e2fe1239c6e10afd85c83bcd6996dfdb434a7 and a commit following a merge, goody goody...lets get a snack diff -r 677e2fe1239c -r 8ba2f1087880 decoupage/web.py --- a/decoupage/web.py Mon Jun 21 18:55:15 2010 -0700 +++ b/decoupage/web.py Wed Jun 30 22:33:59 2010 -0700 @@ -5,6 +5,7 @@ import os from contenttransformer.app import FileTypeTransformer +from contenttransformer.app import transformers from formatters import formatters from genshi.builder import Markup @@ -16,6 +17,8 @@ from pkg_resources import iter_entry_points from webob import Request, Response, exc +transformers = [i.lower() for i in transformers()] + class Decoupage(object): ### class level variables @@ -45,7 +48,7 @@ assert os.path.isdir(directory), "Decoupage template directory %s does not exist!" % directory # static file server - self.fileserver = FileApp + self.fileserver = FileApp # XXX still used?!? # pluggable index data formatters self.formatters = {} @@ -82,7 +85,13 @@ conf = self.conf(request.path_info.rsplit('/',1)[0]) if '/transformer' in conf: args = [i.split('=', 1) for i in conf['/transformer'].split(',') if '=' in i] - fileserver = FileTypeTransformer(*args) + kwargs = {} + for i in conf: + if i.startswith('/'): + name = i[1:].lower() + if name in transformers: + kwargs[name] = dict([j.split('=', 1) for j in conf[i].split(',') if '=' in j]) + fileserver = FileTypeTransformer(*args, **kwargs) else: fileserver = FileApp