Coverage for .tox/coverage/lib/python3.13/site-packages/wuttaweb/views/essential.py: 100%
18 statements
« prev ^ index » next coverage.py v7.17.0, created at 2026-10-24 16:36 -0500
« prev ^ index » next coverage.py v7.17.0, created at 2026-10-24 16:36 -0500
1# -*- coding: utf-8; -*-
2################################################################################
3#
4# wuttaweb -- Web App for Wutta Framework
5# Copyright © 2024-2026 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"""
24Essential views for convenient includes
26Most apps should include this module::
28 pyramid_config.include("wuttaweb.views.essential")
30That will in turn include the following modules:
32* :mod:`wuttaweb.views.common`
33* :mod:`wuttaweb.views.auth`
34* :mod:`wuttaweb.views.email`
35* :mod:`wuttaweb.views.settings`
36* :mod:`wuttaweb.views.progress`
37* :mod:`wuttaweb.views.people`
38* :mod:`wuttaweb.views.roles`
39* :mod:`wuttaweb.views.users`
40* :mod:`wuttaweb.views.problems`
41* :mod:`wuttaweb.views.upgrades`
42* :mod:`wuttaweb.views.tables`
43* :mod:`wuttaweb.views.alembic`
44* :mod:`wuttaweb.views.views`
46You can also selectively override some modules while keeping most
47defaults.
49That uses a slightly different approach. First here is how to do it
50while keeping all defaults::
52 from wuttaweb.views import essential
54 essential.defaults(pyramid_config)
56To override, specify the default module with your preferred alias like
57so::
59 essential.defaults(pyramid_config, **{
60 "wuttaweb.views.users": "poser.web.views.users",
61 "wuttaweb.views.upgrades": "poser.web.views.upgrades",
62 })
63"""
66def defaults(config, **kwargs): # pylint: disable=missing-function-docstring
68 def mod(spec):
69 return kwargs.get(spec, spec)
71 config.include(mod("wuttaweb.views.common"))
72 config.include(mod("wuttaweb.views.auth"))
73 config.include(mod("wuttaweb.views.email"))
74 config.include(mod("wuttaweb.views.settings"))
75 config.include(mod("wuttaweb.views.progress"))
76 config.include(mod("wuttaweb.views.people"))
77 config.include(mod("wuttaweb.views.roles"))
78 config.include(mod("wuttaweb.views.users"))
79 config.include(mod("wuttaweb.views.problems"))
80 config.include(mod("wuttaweb.views.upgrades"))
81 config.include(mod("wuttaweb.views.tables"))
82 config.include(mod("wuttaweb.views.alembic"))
83 config.include(mod("wuttaweb.views.views"))
86def includeme(config): # pylint: disable=missing-function-docstring
87 defaults(config)