15.2.103. camcops_server.cc_modules.cc_constants¶
camcops_server/cc_modules/cc_constants.py
Copyright (C) 2012, University of Cambridge, Department of Psychiatry. Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
This file is part of CamCOPS.
CamCOPS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
CamCOPS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
Various constants.
- class camcops_server.cc_modules.cc_constants.ConfigDefaults(docker: bool = False)[source]¶
Contains default values for the config, plus some cosmetic defaults for generating specimen config files.
Re
CHERRYPY_THREADS_MAX
: beware the default MySQL connection limit of 151; https://dev.mysql.com/doc/refman/5.7/en/too-many-connections.html
- __init__(docker: bool = False) None [source]¶
- Parameters
docker – Amend defaults so it works within a Docker Compose application without much fiddling?
Defaults for use within Docker:
Note that a URL to another container/service looks like
protocol://container:port/
. Values here must match the Docker Compose file.
- property demo_db_url: str¶
The demonstration SQLAlchemy URL.
- class camcops_server.cc_modules.cc_constants.ConfigParamExportGeneral[source]¶
Parameters allowed in the
[export]
section of the CamCOPS config file.
- class camcops_server.cc_modules.cc_constants.ConfigParamExportRecipient[source]¶
Possible configuration file parameters that relate to “export recipient” definitions.
- class camcops_server.cc_modules.cc_constants.ConfigParamServer[source]¶
Parameters allowed in the web server (
[server]
) section of the CamCOPS config file.
- class camcops_server.cc_modules.cc_constants.ConfigParamSite[source]¶
Parameters allowed in the main
[site]
section of the CamCOPS config file.
- class camcops_server.cc_modules.cc_constants.CssClass[source]¶
CSS names.
Values should match e.g.
camcops_server/templates/css/css_base.mako
.
- class camcops_server.cc_modules.cc_constants.DockerConstants[source]¶
Constants for the Docker environment.
- class camcops_server.cc_modules.cc_constants.FHIRConst[source]¶
Constants used, mainly as dictionary keys, by the Python
fhirclient
package.Capitalized: usually FHIR object types
lower_case or lowerCamelCase: usually dictionary keys
plainlowercase: often string constants
- class camcops_server.cc_modules.cc_constants.FileType[source]¶
Used to represent output formats and their file extensions.
- class camcops_server.cc_modules.cc_constants.MatplotlibConstants[source]¶
Constants used by matplotlib
- class camcops_server.cc_modules.cc_constants.MfaMethod[source]¶
Open multi-factor authentication (MFA) standards are defined in RFC 4226 (HOTP: An HMAC-Based One-Time Password Algorithm) and in RFC 6238 (TOTP: Time-Based One-Time Password Algorithm).
HMAC: Hash-based Message Authentication Code https://en.wikipedia.org/wiki/HMAC
Values must be in lower case.
- classmethod clean(method: str) str [source]¶
Returns a valid method, even if the input isn’t. Defaults to NO_MFA.