Coverage for .tox/coverage/lib/python3.11/site-packages/wuttaweb/helpers.py: 100%

3 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-08-06 23:17 -0500

1# -*- coding: utf-8; -*- 

2################################################################################ 

3# 

4# wuttaweb -- Web App for Wutta Framework 

5# Copyright © 2024 Lance Edgar 

6# 

7# This file is part of Wutta Framework. 

8# 

9# Wutta Framework is free software: you can redistribute it and/or modify it 

10# under the terms of the GNU General Public License as published by the Free 

11# Software Foundation, either version 3 of the License, or (at your option) any 

12# later version. 

13# 

14# Wutta Framework is distributed in the hope that it will be useful, but 

15# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 

16# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 

17# more details. 

18# 

19# You should have received a copy of the GNU General Public License along with 

20# Wutta Framework. If not, see <http://www.gnu.org/licenses/>. 

21# 

22################################################################################ 

23""" 

24Template Context Helpers 

25 

26This module serves as a collection of various things deemed useful for 

27all template renderers. It is made available as simply ``h`` within 

28the template context. 

29 

30You can access anything provided by ``h`` within a template then, for 

31instance: 

32 

33.. code-block:: mako 

34 

35 ${h.link_to('python', 'https://www.python.org')} 

36 

37(Note that ``link_to()`` comes from ``webhelpers2.html.tags``.) 

38 

39This module contains the following references: 

40 

41* all names from :mod:`webhelpers2:webhelpers2.html` 

42* all names from :mod:`webhelpers2:webhelpers2.html.tags` 

43* :func:`~wuttaweb.util.get_liburl()` 

44* :func:`~wuttaweb.util.get_csrf_token()` 

45* :func:`~wuttaweb.util.render_csrf_token()` (as :func:`csrf_token()`) 

46 

47.. function:: csrf_token 

48 

49 This is a shorthand reference to 

50 :func:`wuttaweb.util.render_csrf_token()`. 

51 

52""" 

53 

54from webhelpers2.html import * 

55from webhelpers2.html.tags import * 

56 

57from wuttaweb.util import get_liburl, get_csrf_token, render_csrf_token as csrf_token