# HG changeset patch # User Jeff Hammel # Date 1277960953 25200 # Node ID 9d51954e2e68bc275e3ec2ded81e43989311164a # Parent 59496de899977b00c000a2ab2a36b9ce99310f7f allow transformers to take kwargs diff -r 59496de89997 -r 9d51954e2e68 contenttransformer/app.py --- a/contenttransformer/app.py Wed Jun 30 22:01:50 2010 -0700 +++ b/contenttransformer/app.py Wed Jun 30 22:09:13 2010 -0700 @@ -12,8 +12,7 @@ """types is a list of two-tuples: glob pattern (string), transformer name (string, name of entry point)""" self.types = types - # intended to be arguments to the xformers - # XXX unused + # arguments to the xformers self.kwargs = kwargs self.transformers = transformers() @@ -34,8 +33,8 @@ # XXX hack: -> refactor if '/' in transformer_name: return ContentTypeChanger(content, content_type, transformer_name) - - return self.transformers[transformer_name](content, content_type) + + return self.transformers[transformer_name](content, content_type, **self.kwargs.get(transformer_name, {})) return FileApp(path)