mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
Previous cleanups (mostly the removals of Python __future__ imports) were done in a way that introduced leading newlines. Delete leading newlines from all files, except static/assets/zulip-emoji/NOTICE, which is a verbatim copy of the Apache 2.0 license. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
29 lines
854 B
Python
29 lines
854 B
Python
from typing import Any
|
|
|
|
from django.template.defaultfilters import slugify, pluralize
|
|
from django.urls import reverse
|
|
from django.utils import translation
|
|
from django.utils.timesince import timesince
|
|
from jinja2 import Environment
|
|
from two_factor.templatetags.two_factor import device_action
|
|
|
|
from zerver.templatetags.app_filters import display_list, render_markdown_path
|
|
|
|
|
|
def environment(**options: Any) -> Environment:
|
|
env = Environment(**options)
|
|
env.globals.update({
|
|
'url': reverse,
|
|
'render_markdown_path': render_markdown_path,
|
|
})
|
|
|
|
env.install_gettext_translations(translation, True)
|
|
|
|
env.filters['slugify'] = slugify
|
|
env.filters['pluralize'] = pluralize
|
|
env.filters['display_list'] = display_list
|
|
env.filters['device_action'] = device_action
|
|
env.filters['timesince'] = timesince
|
|
|
|
return env
|