image_filter now support args and kwargs.

This commit is contained in:
Christopher Ramírez 2014-09-07 11:14:10 -06:00
parent 6b6717a309
commit 75015dd248

View file

@ -556,12 +556,17 @@ class Renderer(object):
return ''.join(node_as_str for node_as_str in map(node_to_string, return ''.join(node_as_str for node_as_str in map(node_to_string,
xml_object.getElementsByTagName('html')[0].childNodes)) xml_object.getElementsByTagName('html')[0].childNodes))
def image_filter(self, value): def image_filter(self, value, *args, **kwargs):
"""Store value into template_images and return the key name where this """Store value into template_images and return the key name where this
method stored it. The value returned it later used to load the image method stored it. The value returned it later used to load the image
from media loader and finally inserted into the final ODT document.""" from media loader and finally inserted into the final ODT document."""
key = uuid4().hex key = uuid4().hex
self.template_images[key] = value self.template_images[key] = {
'value': value,
'args': args,
'kwargs': kwargs
}
return key return key