Coverage for gws-app/gws/base/project/__init__.py: 100%
1 statements
« prev ^ index » next coverage.py v7.16.2, created at 2026-10-05 13:35 +0200
« prev ^ index » next coverage.py v7.16.2, created at 2026-10-05 13:35 +0200
1"""Projects.
3A project is a self-contained map application inside the GWS application. It has
4its own main map and optional overview map, and its own actions, finders, models,
5printers, exporters, templates, OWS services, client settings and assets. Projects
6are configured in the ``projects`` list of the application config; the client
7addresses a project by its uid.
9Submodules:
11- ``core``: the project object (``gws.Project``) with its ``Config`` and ``Props``.
12- ``action``: the ``project`` action, whose ``projectInfo`` command returns the
13 project props, the locale and the current user to the client.
15Most project settings complement the application settings. Printers and exporters
16are offered along with the global ones; the client gets the printers the user can
17use, project printers first, or else the application default printer. The project
18assets directory is checked before the global one, and the project metadata is
19merged with the application metadata. A project ``client`` replaces the
20application client. If no locales are configured, the application locales are
21used. The project title is taken from the ``title`` option, then from the
22metadata, then from the uid.
24The project description sent to the client is rendered from a template with the
25subject ``project.description``. The project home page (``/project/<uid>``) is
26rendered from a template with the subject ``project.home`` by the ``web`` action.
28Example::
30 {
31 actions [
32 { type "project" }
33 ]
34 projects [
35 {
36 uid "project_1"
37 title "Project 1"
38 map {
39 layers [ ... ]
40 }
41 templates [
42 { subject "project.description" type "html" path "/data/description.cx.html" }
43 ]
44 }
45 ]
46 }
47"""
49from .core import Config, Object, Props