geovisio 2.8.1__py3-none-any.whl → 2.10.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- geovisio/__init__.py +6 -1
- geovisio/config_app.py +16 -5
- geovisio/translations/ar/LC_MESSAGES/messages.mo +0 -0
- geovisio/translations/ar/LC_MESSAGES/messages.po +818 -0
- geovisio/translations/br/LC_MESSAGES/messages.po +1 -1
- geovisio/translations/da/LC_MESSAGES/messages.mo +0 -0
- geovisio/translations/da/LC_MESSAGES/messages.po +4 -3
- geovisio/translations/de/LC_MESSAGES/messages.mo +0 -0
- geovisio/translations/de/LC_MESSAGES/messages.po +55 -2
- geovisio/translations/el/LC_MESSAGES/messages.po +1 -1
- geovisio/translations/en/LC_MESSAGES/messages.mo +0 -0
- geovisio/translations/en/LC_MESSAGES/messages.po +193 -139
- geovisio/translations/eo/LC_MESSAGES/messages.mo +0 -0
- geovisio/translations/eo/LC_MESSAGES/messages.po +53 -4
- geovisio/translations/es/LC_MESSAGES/messages.po +1 -1
- geovisio/translations/fi/LC_MESSAGES/messages.po +1 -1
- geovisio/translations/fr/LC_MESSAGES/messages.mo +0 -0
- geovisio/translations/fr/LC_MESSAGES/messages.po +101 -6
- geovisio/translations/hu/LC_MESSAGES/messages.po +1 -1
- geovisio/translations/it/LC_MESSAGES/messages.mo +0 -0
- geovisio/translations/it/LC_MESSAGES/messages.po +63 -3
- geovisio/translations/ja/LC_MESSAGES/messages.po +1 -1
- geovisio/translations/ko/LC_MESSAGES/messages.po +1 -1
- geovisio/translations/messages.pot +185 -129
- geovisio/translations/nl/LC_MESSAGES/messages.mo +0 -0
- geovisio/translations/nl/LC_MESSAGES/messages.po +421 -86
- geovisio/translations/oc/LC_MESSAGES/messages.mo +0 -0
- geovisio/translations/oc/LC_MESSAGES/messages.po +818 -0
- geovisio/translations/pl/LC_MESSAGES/messages.po +1 -1
- geovisio/translations/sv/LC_MESSAGES/messages.mo +0 -0
- geovisio/translations/sv/LC_MESSAGES/messages.po +823 -0
- geovisio/translations/ti/LC_MESSAGES/messages.mo +0 -0
- geovisio/translations/ti/LC_MESSAGES/messages.po +762 -0
- geovisio/translations/zh_Hant/LC_MESSAGES/messages.po +1 -1
- geovisio/utils/annotations.py +183 -0
- geovisio/utils/auth.py +14 -13
- geovisio/utils/cql2.py +134 -0
- geovisio/utils/db.py +7 -0
- geovisio/utils/fields.py +38 -9
- geovisio/utils/items.py +44 -0
- geovisio/utils/model_query.py +4 -4
- geovisio/utils/pic_shape.py +63 -0
- geovisio/utils/pictures.py +164 -29
- geovisio/utils/reports.py +10 -17
- geovisio/utils/semantics.py +196 -57
- geovisio/utils/sentry.py +1 -2
- geovisio/utils/sequences.py +191 -93
- geovisio/utils/tags.py +31 -0
- geovisio/utils/upload_set.py +287 -209
- geovisio/utils/website.py +1 -1
- geovisio/web/annotations.py +346 -9
- geovisio/web/auth.py +1 -1
- geovisio/web/collections.py +73 -54
- geovisio/web/configuration.py +26 -5
- geovisio/web/docs.py +143 -11
- geovisio/web/items.py +232 -155
- geovisio/web/map.py +25 -13
- geovisio/web/params.py +55 -52
- geovisio/web/pictures.py +34 -0
- geovisio/web/stac.py +19 -12
- geovisio/web/tokens.py +49 -1
- geovisio/web/upload_set.py +148 -37
- geovisio/web/users.py +4 -4
- geovisio/web/utils.py +2 -2
- geovisio/workers/runner_pictures.py +190 -24
- {geovisio-2.8.1.dist-info → geovisio-2.10.0.dist-info}/METADATA +27 -26
- geovisio-2.10.0.dist-info/RECORD +105 -0
- {geovisio-2.8.1.dist-info → geovisio-2.10.0.dist-info}/WHEEL +1 -1
- geovisio-2.8.1.dist-info/RECORD +0 -92
- {geovisio-2.8.1.dist-info → geovisio-2.10.0.dist-info}/licenses/LICENSE +0 -0
geovisio/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""GeoVisio API - Main"""
|
|
2
2
|
|
|
3
|
-
__version__ = "2.
|
|
3
|
+
__version__ = "2.10.0"
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
6
|
from flask import Flask, jsonify, stream_template, send_from_directory, redirect, request, url_for
|
|
@@ -54,6 +54,11 @@ LOGGING_CONFIG = {
|
|
|
54
54
|
},
|
|
55
55
|
"loggers": {
|
|
56
56
|
"PIL": {"handlers": ["stdout", "stderr"], "level": "WARN", "propagate": False}, # lower PIL loggers to only have warnings
|
|
57
|
+
"watchdog": {
|
|
58
|
+
"handlers": ["stdout", "stderr"],
|
|
59
|
+
"level": "WARN",
|
|
60
|
+
"propagate": False,
|
|
61
|
+
}, # lower watchdog loggers too (used by flask hot reload)
|
|
57
62
|
},
|
|
58
63
|
"root": {"level": "INFO", "handlers": ["stderr", "stdout"]},
|
|
59
64
|
}
|
geovisio/config_app.py
CHANGED
|
@@ -17,10 +17,10 @@ from geovisio.utils.website import Website
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class ApiSummary(BaseModel):
|
|
20
|
-
name: Dict[str, str] = {"en": "
|
|
20
|
+
name: Dict[str, str] = {"en": "Panoramax"}
|
|
21
21
|
description: Dict[str, str] = {"en": "The open source photo mapping solution"}
|
|
22
|
-
logo: HttpUrl = "https://gitlab.com/panoramax/gitlab-profile/-/raw/main/images/
|
|
23
|
-
color: Color = "#
|
|
22
|
+
logo: HttpUrl = "https://gitlab.com/panoramax/gitlab-profile/-/raw/main/images/panoramax.svg"
|
|
23
|
+
color: Color = "#5e499c"
|
|
24
24
|
email: EmailStr = "panoramax@panoramax.fr"
|
|
25
25
|
geo_coverage: Dict[str, str] = {"en": "Worldwide\nThe picture can be sent from anywhere in the world."}
|
|
26
26
|
|
|
@@ -29,10 +29,12 @@ class DefaultConfig:
|
|
|
29
29
|
API_SUMMARY = ApiSummary()
|
|
30
30
|
API_VIEWER_PAGE = "viewer.html"
|
|
31
31
|
API_MAIN_PAGE = "main.html"
|
|
32
|
-
# we default we keep the session cookie 7 days, users would have to renew their
|
|
32
|
+
# we default we keep the session cookie 7 days, users would have to renew their login after this
|
|
33
33
|
PERMANENT_SESSION_LIFETIME = datetime.timedelta(days=7).total_seconds()
|
|
34
34
|
API_FORCE_AUTH_ON_UPLOAD = False
|
|
35
35
|
PICTURE_PROCESS_DERIVATES_STRATEGY = "ON_DEMAND"
|
|
36
|
+
PICTURE_PROCESS_NB_RETRIES = 5
|
|
37
|
+
PICTURE_PROCESS_KEEP_UNBLURRED_PARTS = False
|
|
36
38
|
API_BLUR_URL = None
|
|
37
39
|
PICTURE_PROCESS_THREADS_LIMIT = 1
|
|
38
40
|
DB_CHECK_SCHEMA = True # If True check the database schema, and do not start the api if not up to date
|
|
@@ -51,6 +53,7 @@ class DefaultConfig:
|
|
|
51
53
|
API_WEBSITE_URL = (
|
|
52
54
|
website.WEBSITE_UNDER_SAME_HOST
|
|
53
55
|
) # by default we consider that there is a panoramax website on the same host as the API
|
|
56
|
+
API_REGISTRATION_IS_OPEN = False # tells that anyone can create an account. Only used for reference in the federation for the moment
|
|
54
57
|
|
|
55
58
|
|
|
56
59
|
def read_config(app, test_config):
|
|
@@ -92,10 +95,13 @@ def read_config(app, test_config):
|
|
|
92
95
|
"API_DEFAULT_COLLABORATIVE_METADATA_EDITING",
|
|
93
96
|
"API_ENFORCE_TOS_ACCEPTANCE",
|
|
94
97
|
"API_WEBSITE_URL",
|
|
98
|
+
"API_REGISTRATION_IS_OPEN",
|
|
95
99
|
# Picture process
|
|
96
100
|
"PICTURE_PROCESS_DERIVATES_STRATEGY",
|
|
97
101
|
"PICTURE_PROCESS_THREADS_LIMIT",
|
|
98
102
|
"PICTURE_PROCESS_REFRESH_CRON",
|
|
103
|
+
"PICTURE_PROCESS_NB_RETRIES",
|
|
104
|
+
"PICTURE_PROCESS_KEEP_UNBLURRED_PARTS",
|
|
99
105
|
# OAUTH
|
|
100
106
|
"OAUTH_PROVIDER",
|
|
101
107
|
"OAUTH_OIDC_URL",
|
|
@@ -139,7 +145,7 @@ def read_config(app, test_config):
|
|
|
139
145
|
app.config.update(test_config)
|
|
140
146
|
|
|
141
147
|
if "API_LOG_LEVEL" in app.config:
|
|
142
|
-
logging.getLogger(
|
|
148
|
+
logging.getLogger().setLevel(app.config["API_LOG_LEVEL"].upper())
|
|
143
149
|
|
|
144
150
|
# Create DB_URL from separated parameters
|
|
145
151
|
if "DB_PORT" in app.config or "DB_HOST" in app.config or "DB_USERNAME" in app.config or "DB_PASSWORD" in app.config:
|
|
@@ -165,6 +171,7 @@ def read_config(app, test_config):
|
|
|
165
171
|
raise Exception(
|
|
166
172
|
f"Unknown picture derivates strategy: '{app.config['PICTURE_PROCESS_DERIVATES_STRATEGY']}'. Please set to one of ON_DEMAND, PREPROCESS"
|
|
167
173
|
)
|
|
174
|
+
app.config["PICTURE_PROCESS_NB_RETRIES"] = int(app.config["PICTURE_PROCESS_NB_RETRIES"])
|
|
168
175
|
|
|
169
176
|
# Parse API summary
|
|
170
177
|
if not isinstance(app.config.get("API_SUMMARY"), ApiSummary):
|
|
@@ -178,6 +185,8 @@ def read_config(app, test_config):
|
|
|
178
185
|
except Exception as e:
|
|
179
186
|
raise Exception("Parameter API_SUMMARY is not recognized") from e
|
|
180
187
|
|
|
188
|
+
app.config["API_REGISTRATION_IS_OPEN"] = _read_bool(app.config, "API_REGISTRATION_IS_OPEN")
|
|
189
|
+
|
|
181
190
|
# Checks on front-end related variables
|
|
182
191
|
templateFolder = os.path.join(app.root_path, app.template_folder)
|
|
183
192
|
for pageParam in ["API_MAIN_PAGE", "API_VIEWER_PAGE"]:
|
|
@@ -220,6 +229,8 @@ def read_config(app, test_config):
|
|
|
220
229
|
if not croniter.croniter.is_valid(cron_val):
|
|
221
230
|
raise Exception(f"PICTURE_PROCESS_REFRESH_CRON should be a valid cron syntax, got '{cron_val}'")
|
|
222
231
|
|
|
232
|
+
app.config["PICTURE_PROCESS_KEEP_UNBLURRED_PARTS"] = _read_bool(app.config, "PICTURE_PROCESS_KEEP_UNBLURRED_PARTS")
|
|
233
|
+
|
|
223
234
|
app.config["API_ACCEPT_DUPLICATE"] = _read_bool(app.config, "API_ACCEPT_DUPLICATE")
|
|
224
235
|
app.config["API_ENFORCE_TOS_ACCEPTANCE"] = _read_bool(app.config, "API_ENFORCE_TOS_ACCEPTANCE")
|
|
225
236
|
app.config["API_DEFAULT_COLLABORATIVE_METADATA_EDITING"] = _read_bool(app.config, "API_DEFAULT_COLLABORATIVE_METADATA_EDITING")
|
|
Binary file
|