Skip to content

Instantly share code, notes, and snippets.

@philfreo
Created March 21, 2013 22:57
Show Gist options
  • Save philfreo/5217582 to your computer and use it in GitHub Desktop.
Save philfreo/5217582 to your computer and use it in GitHub Desktop.
wrap MimeRender decorator so you have access to the original wrapped function
class MimeRender(mimerender.FlaskMimeRender):
def __call__(self, *args, **kwargs):
ret = super(MimeRender, self).__call__(*args, **kwargs)
def wrap(target):
target._orig_func = target
return ret(target)
return wrap
mimerender = MimeRender()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment