diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-07-31 14:21:09 +0200 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-07-31 14:21:09 +0200 |
commit | db3430a82b730f6651817780b6079cd69be77913 (patch) | |
tree | 14bd1340288846eee735e9ea2a37820ade3d2c2c | |
parent | 51e2942dc7e969f0bf5f67fbeffa342f13db7c58 (diff) | |
download | backoffice-db3430a82b730f6651817780b6079cd69be77913.tar.gz backoffice-db3430a82b730f6651817780b6079cd69be77913.tar.bz2 backoffice-db3430a82b730f6651817780b6079cd69be77913.zip |
Cut deadcode off.
-rw-r--r-- | talerbackoffice/backoffice/templates/i18nfix.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/talerbackoffice/backoffice/templates/i18nfix.py b/talerbackoffice/backoffice/templates/i18nfix.py deleted file mode 100644 index 331706a..0000000 --- a/talerbackoffice/backoffice/templates/i18nfix.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python3 -# This file is in the public domain. - -""" -Extract translations from a Jinja2 template, stripping leading newlines. - -@author Florian Dold -""" - -import jinja2.ext -import re - -def normalize(message): - message = message.strip() - # collapse whitespaces (including newlines) into one space. - message = re.sub("\s+", " ", message) - return message - - -def babel_extract(fileobj, keywords, comment_tags, options): - res = jinja2.ext.babel_extract(fileobj, keywords, comment_tags, options) - for lineno, funcname, message, comments in res: - message = normalize(message) - yield lineno, funcname, message, comments - -def wrap_gettext(f): - """ - Call gettext with whitespace normalized. - """ - def wrapper(message): - message = normalize(message) - return f(message) - return wrapper |