geo-activity-playground 0.38.2__py3-none-any.whl → 0.39.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.
- geo_activity_playground/__main__.py +5 -47
- geo_activity_playground/alembic/README +1 -0
- geo_activity_playground/alembic/env.py +76 -0
- geo_activity_playground/alembic/script.py.mako +26 -0
- geo_activity_playground/alembic/versions/451e7836b53d_add_square_planner_bookmark.py +33 -0
- geo_activity_playground/alembic/versions/63d3b7f6f93c_initial_version.py +73 -0
- geo_activity_playground/alembic/versions/ab83b9d23127_add_upstream_id.py +28 -0
- geo_activity_playground/alembic/versions/b03491c593f6_add_crop_indices.py +30 -0
- geo_activity_playground/alembic/versions/e02e27876deb_add_square_planner_bookmark_name.py +28 -0
- geo_activity_playground/alembic/versions/script.py.mako +28 -0
- geo_activity_playground/core/activities.py +50 -136
- geo_activity_playground/core/config.py +3 -3
- geo_activity_playground/core/datamodel.py +257 -0
- geo_activity_playground/core/enrichment.py +90 -92
- geo_activity_playground/core/heart_rate.py +1 -2
- geo_activity_playground/core/paths.py +6 -7
- geo_activity_playground/core/raster_map.py +43 -4
- geo_activity_playground/core/similarity.py +1 -2
- geo_activity_playground/core/tasks.py +2 -2
- geo_activity_playground/core/test_meta_search.py +3 -3
- geo_activity_playground/core/test_summary_stats.py +1 -1
- geo_activity_playground/explorer/grid_file.py +2 -2
- geo_activity_playground/explorer/tile_visits.py +8 -10
- geo_activity_playground/heatmap_video.py +7 -8
- geo_activity_playground/importers/activity_parsers.py +2 -2
- geo_activity_playground/importers/directory.py +9 -10
- geo_activity_playground/importers/strava_api.py +9 -9
- geo_activity_playground/importers/strava_checkout.py +12 -13
- geo_activity_playground/importers/test_csv_parser.py +3 -3
- geo_activity_playground/importers/test_directory.py +1 -1
- geo_activity_playground/importers/test_strava_api.py +1 -1
- geo_activity_playground/webui/app.py +94 -86
- geo_activity_playground/webui/authenticator.py +1 -1
- geo_activity_playground/webui/{activity/controller.py → blueprints/activity_blueprint.py} +246 -108
- geo_activity_playground/webui/{auth_blueprint.py → blueprints/auth_blueprint.py} +1 -1
- geo_activity_playground/webui/blueprints/bubble_chart_blueprint.py +61 -0
- geo_activity_playground/webui/{calendar/controller.py → blueprints/calendar_blueprint.py} +19 -19
- geo_activity_playground/webui/{eddington_blueprint.py → blueprints/eddington_blueprint.py} +5 -5
- geo_activity_playground/webui/blueprints/entry_views.py +68 -0
- geo_activity_playground/webui/{equipment_blueprint.py → blueprints/equipment_blueprint.py} +37 -4
- geo_activity_playground/webui/{explorer/controller.py → blueprints/explorer_blueprint.py} +88 -54
- geo_activity_playground/webui/blueprints/heatmap_blueprint.py +233 -0
- geo_activity_playground/webui/{search_blueprint.py → blueprints/search_blueprint.py} +7 -11
- geo_activity_playground/webui/blueprints/settings_blueprint.py +446 -0
- geo_activity_playground/webui/{square_planner_blueprint.py → blueprints/square_planner_blueprint.py} +31 -6
- geo_activity_playground/webui/{summary_blueprint.py → blueprints/summary_blueprint.py} +11 -23
- geo_activity_playground/webui/blueprints/tile_blueprint.py +27 -0
- geo_activity_playground/webui/{upload_blueprint.py → blueprints/upload_blueprint.py} +13 -18
- geo_activity_playground/webui/flasher.py +26 -0
- geo_activity_playground/webui/plot_util.py +1 -1
- geo_activity_playground/webui/search_util.py +4 -6
- geo_activity_playground/webui/static/images/layers-2x.png +0 -0
- geo_activity_playground/webui/static/images/layers.png +0 -0
- geo_activity_playground/webui/static/images/marker-icon-2x.png +0 -0
- geo_activity_playground/webui/static/images/marker-icon.png +0 -0
- geo_activity_playground/webui/static/images/marker-shadow.png +0 -0
- geo_activity_playground/webui/templates/activity/day.html.j2 +81 -0
- geo_activity_playground/webui/templates/activity/edit.html.j2 +38 -0
- geo_activity_playground/webui/{activity/templates → templates}/activity/name.html.j2 +29 -27
- geo_activity_playground/webui/{activity/templates → templates}/activity/show.html.j2 +57 -33
- geo_activity_playground/webui/templates/activity/trim.html.j2 +68 -0
- geo_activity_playground/webui/templates/bubble_chart/index.html.j2 +26 -0
- geo_activity_playground/webui/templates/calendar/index.html.j2 +48 -0
- geo_activity_playground/webui/templates/calendar/month.html.j2 +57 -0
- geo_activity_playground/webui/templates/equipment/index.html.j2 +7 -0
- geo_activity_playground/webui/templates/home.html.j2 +6 -6
- geo_activity_playground/webui/templates/page.html.j2 +2 -1
- geo_activity_playground/webui/{settings/templates → templates}/settings/index.html.j2 +9 -20
- geo_activity_playground/webui/templates/settings/manage-equipments.html.j2 +49 -0
- geo_activity_playground/webui/templates/settings/manage-kinds.html.j2 +48 -0
- geo_activity_playground/webui/{settings/templates → templates}/settings/privacy-zones.html.j2 +2 -0
- geo_activity_playground/webui/{settings/templates → templates}/settings/strava.html.j2 +2 -0
- geo_activity_playground/webui/templates/square_planner/index.html.j2 +63 -13
- {geo_activity_playground-0.38.2.dist-info → geo_activity_playground-0.39.0.dist-info}/METADATA +5 -1
- geo_activity_playground-0.39.0.dist-info/RECORD +133 -0
- geo_activity_playground/__init__.py +0 -0
- geo_activity_playground/core/__init__.py +0 -0
- geo_activity_playground/explorer/__init__.py +0 -0
- geo_activity_playground/importers/__init__.py +0 -0
- geo_activity_playground/webui/__init__.py +0 -0
- geo_activity_playground/webui/activity/__init__.py +0 -0
- geo_activity_playground/webui/activity/blueprint.py +0 -109
- geo_activity_playground/webui/activity/templates/activity/day.html.j2 +0 -80
- geo_activity_playground/webui/activity/templates/activity/edit.html.j2 +0 -42
- geo_activity_playground/webui/calendar/__init__.py +0 -0
- geo_activity_playground/webui/calendar/blueprint.py +0 -23
- geo_activity_playground/webui/calendar/templates/calendar/index.html.j2 +0 -46
- geo_activity_playground/webui/calendar/templates/calendar/month.html.j2 +0 -55
- geo_activity_playground/webui/entry_controller.py +0 -63
- geo_activity_playground/webui/explorer/__init__.py +0 -0
- geo_activity_playground/webui/explorer/blueprint.py +0 -62
- geo_activity_playground/webui/heatmap/__init__.py +0 -0
- geo_activity_playground/webui/heatmap/blueprint.py +0 -51
- geo_activity_playground/webui/heatmap/heatmap_controller.py +0 -216
- geo_activity_playground/webui/settings/blueprint.py +0 -262
- geo_activity_playground/webui/settings/controller.py +0 -272
- geo_activity_playground/webui/settings/templates/settings/equipment-offsets.html.j2 +0 -44
- geo_activity_playground/webui/settings/templates/settings/kind-renames.html.j2 +0 -25
- geo_activity_playground/webui/settings/templates/settings/kinds-without-achievements.html.j2 +0 -30
- geo_activity_playground/webui/tile_blueprint.py +0 -42
- geo_activity_playground-0.38.2.dist-info/RECORD +0 -129
- /geo_activity_playground/webui/{activity/templates → templates}/activity/lines.html.j2 +0 -0
- /geo_activity_playground/webui/{explorer/templates → templates}/explorer/index.html.j2 +0 -0
- /geo_activity_playground/webui/{heatmap/templates → templates}/heatmap/index.html.j2 +0 -0
- /geo_activity_playground/webui/{settings/templates → templates}/settings/admin-password.html.j2 +0 -0
- /geo_activity_playground/webui/{settings/templates → templates}/settings/color-schemes.html.j2 +0 -0
- /geo_activity_playground/webui/{settings/templates → templates}/settings/heart-rate.html.j2 +0 -0
- /geo_activity_playground/webui/{settings/templates → templates}/settings/metadata-extraction.html.j2 +0 -0
- /geo_activity_playground/webui/{settings/templates → templates}/settings/segmentation.html.j2 +0 -0
- /geo_activity_playground/webui/{settings/templates → templates}/settings/sharepic.html.j2 +0 -0
- {geo_activity_playground-0.38.2.dist-info → geo_activity_playground-0.39.0.dist-info}/LICENSE +0 -0
- {geo_activity_playground-0.38.2.dist-info → geo_activity_playground-0.39.0.dist-info}/WHEEL +0 -0
- {geo_activity_playground-0.38.2.dist-info → geo_activity_playground-0.39.0.dist-info}/entry_points.txt +0 -0
@@ -4,7 +4,6 @@ import itertools
|
|
4
4
|
import logging
|
5
5
|
import pathlib
|
6
6
|
import pickle
|
7
|
-
from typing import Any
|
8
7
|
from typing import Iterator
|
9
8
|
from typing import Optional
|
10
9
|
from typing import TypedDict
|
@@ -12,15 +11,14 @@ from typing import TypedDict
|
|
12
11
|
import pandas as pd
|
13
12
|
from tqdm import tqdm
|
14
13
|
|
15
|
-
from
|
16
|
-
from
|
17
|
-
from
|
18
|
-
from
|
19
|
-
from
|
20
|
-
from
|
21
|
-
from
|
22
|
-
from
|
23
|
-
from geo_activity_playground.core.tiles import interpolate_missing_tile
|
14
|
+
from ..core.activities import ActivityRepository
|
15
|
+
from ..core.config import Config
|
16
|
+
from ..core.paths import atomic_open
|
17
|
+
from ..core.tasks import try_load_pickle
|
18
|
+
from ..core.tasks import work_tracker_path
|
19
|
+
from ..core.tasks import WorkTracker
|
20
|
+
from ..core.tiles import adjacent_to
|
21
|
+
from ..core.tiles import interpolate_missing_tile
|
24
22
|
|
25
23
|
|
26
24
|
logger = logging.getLogger(__name__)
|
@@ -9,13 +9,13 @@ from PIL import Image
|
|
9
9
|
from PIL import ImageDraw
|
10
10
|
from tqdm import tqdm
|
11
11
|
|
12
|
-
from
|
13
|
-
from
|
14
|
-
from
|
15
|
-
from
|
16
|
-
from
|
17
|
-
from
|
18
|
-
from
|
12
|
+
from .core.activities import ActivityRepository
|
13
|
+
from .core.config import ConfigAccessor
|
14
|
+
from .core.raster_map import convert_to_grayscale
|
15
|
+
from .core.raster_map import map_image_from_tile_bounds
|
16
|
+
from .core.raster_map import OSM_TILE_SIZE
|
17
|
+
from .core.raster_map import tile_bounds_around_center
|
18
|
+
from .core.tiles import compute_tile_float
|
19
19
|
|
20
20
|
|
21
21
|
def main_heatmap_video(options) -> None:
|
@@ -25,7 +25,6 @@ def main_heatmap_video(options) -> None:
|
|
25
25
|
os.chdir(options.basedir)
|
26
26
|
|
27
27
|
repository = ActivityRepository()
|
28
|
-
repository.reload()
|
29
28
|
assert len(repository) > 0
|
30
29
|
config_accessor = ConfigAccessor()
|
31
30
|
|
@@ -13,8 +13,8 @@ import pandas as pd
|
|
13
13
|
import tcxreader.tcxreader
|
14
14
|
import xmltodict
|
15
15
|
|
16
|
-
from
|
17
|
-
from
|
16
|
+
from ..core.datamodel import ActivityMeta
|
17
|
+
from ..core.time_conversion import convert_to_datetime_ns
|
18
18
|
|
19
19
|
logger = logging.getLogger(__name__)
|
20
20
|
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import hashlib
|
2
2
|
import logging
|
3
|
-
import multiprocessing
|
4
3
|
import pathlib
|
5
4
|
import pickle
|
6
5
|
import re
|
@@ -9,15 +8,15 @@ from typing import Optional
|
|
9
8
|
|
10
9
|
from tqdm import tqdm
|
11
10
|
|
12
|
-
from
|
13
|
-
from
|
14
|
-
from
|
15
|
-
from
|
16
|
-
from
|
17
|
-
from
|
18
|
-
from
|
19
|
-
from
|
20
|
-
from
|
11
|
+
from ..core.config import Config
|
12
|
+
from ..core.datamodel import ActivityMeta
|
13
|
+
from ..core.paths import activity_extracted_dir
|
14
|
+
from ..core.paths import activity_extracted_meta_dir
|
15
|
+
from ..core.paths import activity_extracted_time_series_dir
|
16
|
+
from ..core.tasks import stored_object
|
17
|
+
from ..core.tasks import WorkTracker
|
18
|
+
from .activity_parsers import ActivityParseError
|
19
|
+
from .activity_parsers import read_activity
|
21
20
|
|
22
21
|
logger = logging.getLogger(__name__)
|
23
22
|
|
@@ -11,15 +11,15 @@ from stravalib.exc import ObjectNotFound
|
|
11
11
|
from stravalib.exc import RateLimitExceeded
|
12
12
|
from tqdm import tqdm
|
13
13
|
|
14
|
-
from
|
15
|
-
from
|
16
|
-
from
|
17
|
-
from
|
18
|
-
from
|
19
|
-
from
|
20
|
-
from
|
21
|
-
from
|
22
|
-
from
|
14
|
+
from ..core.config import Config
|
15
|
+
from ..core.datamodel import ActivityMeta
|
16
|
+
from ..core.paths import activity_extracted_meta_dir
|
17
|
+
from ..core.paths import activity_extracted_time_series_dir
|
18
|
+
from ..core.paths import strava_api_dir
|
19
|
+
from ..core.paths import strava_last_activity_date_path
|
20
|
+
from ..core.tasks import get_state
|
21
|
+
from ..core.tasks import set_state
|
22
|
+
from ..core.time_conversion import convert_to_datetime_ns
|
23
23
|
|
24
24
|
|
25
25
|
logger = logging.getLogger(__name__)
|
@@ -6,25 +6,24 @@ import shutil
|
|
6
6
|
import sys
|
7
7
|
import traceback
|
8
8
|
from typing import Optional
|
9
|
-
from typing import Union
|
10
9
|
|
11
10
|
import dateutil.parser
|
12
11
|
import numpy as np
|
13
12
|
import pandas as pd
|
14
13
|
from tqdm import tqdm
|
15
14
|
|
16
|
-
from
|
17
|
-
from
|
18
|
-
from
|
19
|
-
from
|
20
|
-
from
|
21
|
-
from
|
22
|
-
from
|
23
|
-
from
|
24
|
-
from
|
25
|
-
from
|
26
|
-
from
|
27
|
-
from
|
15
|
+
from ..core.datamodel import ActivityMeta
|
16
|
+
from ..core.paths import activity_extracted_meta_dir
|
17
|
+
from ..core.paths import activity_extracted_time_series_dir
|
18
|
+
from ..core.paths import strava_last_activity_date_path
|
19
|
+
from ..core.tasks import get_state
|
20
|
+
from ..core.tasks import set_state
|
21
|
+
from ..core.tasks import work_tracker_path
|
22
|
+
from ..core.tasks import WorkTracker
|
23
|
+
from ..core.time_conversion import convert_to_datetime_ns
|
24
|
+
from .activity_parsers import ActivityParseError
|
25
|
+
from .activity_parsers import read_activity
|
26
|
+
from .csv_parser import parse_csv
|
28
27
|
|
29
28
|
|
30
29
|
logger = logging.getLogger(__name__)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import pytest
|
2
2
|
|
3
|
-
from
|
4
|
-
from
|
5
|
-
from
|
3
|
+
from .csv_parser import _parse_cell
|
4
|
+
from .csv_parser import _parse_line
|
5
|
+
from .csv_parser import parse_csv
|
6
6
|
|
7
7
|
|
8
8
|
def test_parse_csv() -> None:
|
@@ -1,46 +1,46 @@
|
|
1
1
|
import datetime
|
2
2
|
import importlib
|
3
3
|
import json
|
4
|
+
import os
|
4
5
|
import pathlib
|
5
6
|
import secrets
|
6
7
|
import shutil
|
7
8
|
import urllib.parse
|
8
9
|
|
9
10
|
from flask import Flask
|
10
|
-
from flask import render_template
|
11
11
|
from flask import request
|
12
|
+
from flask_alembic import Alembic
|
12
13
|
|
13
14
|
from ..core.activities import ActivityRepository
|
14
|
-
from ..core.config import Config
|
15
15
|
from ..core.config import ConfigAccessor
|
16
|
+
from ..core.config import import_old_config
|
17
|
+
from ..core.config import import_old_strava_config
|
18
|
+
from ..core.datamodel import DB
|
19
|
+
from ..core.heart_rate import HeartRateZoneComputer
|
20
|
+
from ..core.raster_map import GrayscaleImageTransform
|
21
|
+
from ..core.raster_map import IdentityImageTransform
|
22
|
+
from ..core.raster_map import PastelImageTransform
|
23
|
+
from ..core.raster_map import TileGetter
|
16
24
|
from ..explorer.tile_visits import TileVisitAccessor
|
17
|
-
from .activity.blueprint import make_activity_blueprint
|
18
|
-
from .activity.controller import ActivityController
|
19
|
-
from .auth_blueprint import make_auth_blueprint
|
20
25
|
from .authenticator import Authenticator
|
21
|
-
from .
|
22
|
-
from .
|
23
|
-
from .
|
24
|
-
from .
|
25
|
-
from .
|
26
|
-
from .
|
27
|
-
from .
|
28
|
-
from .
|
29
|
-
from .
|
30
|
-
from .
|
31
|
-
from .
|
32
|
-
from .
|
33
|
-
from .
|
34
|
-
from .
|
35
|
-
from
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
entry_controller = EntryController(repository, config)
|
40
|
-
|
41
|
-
@app.route("/")
|
42
|
-
def index():
|
43
|
-
return render_template("home.html.j2", **entry_controller.render())
|
26
|
+
from .blueprints.activity_blueprint import make_activity_blueprint
|
27
|
+
from .blueprints.auth_blueprint import make_auth_blueprint
|
28
|
+
from .blueprints.bubble_chart_blueprint import make_bubble_chart_blueprint
|
29
|
+
from .blueprints.calendar_blueprint import make_calendar_blueprint
|
30
|
+
from .blueprints.eddington_blueprint import register_eddington_blueprint
|
31
|
+
from .blueprints.entry_views import register_entry_views
|
32
|
+
from .blueprints.equipment_blueprint import make_equipment_blueprint
|
33
|
+
from .blueprints.explorer_blueprint import make_explorer_blueprint
|
34
|
+
from .blueprints.heatmap_blueprint import make_heatmap_blueprint
|
35
|
+
from .blueprints.search_blueprint import make_search_blueprint
|
36
|
+
from .blueprints.settings_blueprint import make_settings_blueprint
|
37
|
+
from .blueprints.square_planner_blueprint import make_square_planner_blueprint
|
38
|
+
from .blueprints.summary_blueprint import make_summary_blueprint
|
39
|
+
from .blueprints.tile_blueprint import make_tile_blueprint
|
40
|
+
from .blueprints.upload_blueprint import make_upload_blueprint
|
41
|
+
from .blueprints.upload_blueprint import scan_for_activities
|
42
|
+
from .flasher import FlaskFlasher
|
43
|
+
from .search_util import SearchQueryHistory
|
44
44
|
|
45
45
|
|
46
46
|
def get_secret_key():
|
@@ -56,15 +56,39 @@ def get_secret_key():
|
|
56
56
|
|
57
57
|
|
58
58
|
def web_ui_main(
|
59
|
-
|
60
|
-
|
61
|
-
config_accessor: ConfigAccessor,
|
59
|
+
basedir: pathlib.Path,
|
60
|
+
skip_reload: bool,
|
62
61
|
host: str,
|
63
62
|
port: int,
|
64
63
|
) -> None:
|
65
|
-
|
64
|
+
os.chdir(basedir)
|
66
65
|
|
67
66
|
app = Flask(__name__)
|
67
|
+
|
68
|
+
app.config["SQLALCHEMY_DATABASE_URI"] = (
|
69
|
+
f"sqlite:///{basedir.absolute()}/database.sqlite"
|
70
|
+
)
|
71
|
+
app.config["ALEMBIC"] = {"script_location": "../alembic/versions"}
|
72
|
+
DB.init_app(app)
|
73
|
+
|
74
|
+
alembic = Alembic()
|
75
|
+
alembic.init_app(app)
|
76
|
+
|
77
|
+
with app.app_context():
|
78
|
+
alembic.upgrade()
|
79
|
+
DB.session.commit()
|
80
|
+
# DB.create_all()
|
81
|
+
|
82
|
+
repository = ActivityRepository()
|
83
|
+
tile_visit_accessor = TileVisitAccessor()
|
84
|
+
config_accessor = ConfigAccessor()
|
85
|
+
import_old_config(config_accessor)
|
86
|
+
import_old_strava_config(config_accessor)
|
87
|
+
|
88
|
+
if not skip_reload:
|
89
|
+
with app.app_context():
|
90
|
+
scan_for_activities(repository, tile_visit_accessor, config_accessor())
|
91
|
+
|
68
92
|
app.config["UPLOAD_FOLDER"] = "Activities"
|
69
93
|
app.secret_key = get_secret_key()
|
70
94
|
|
@@ -82,67 +106,51 @@ def web_ui_main(
|
|
82
106
|
|
83
107
|
authenticator = Authenticator(config_accessor())
|
84
108
|
search_query_history = SearchQueryHistory(config_accessor, authenticator)
|
85
|
-
|
86
109
|
config = config_accessor()
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
app
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
make_explorer_blueprint(
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
make_heatmap_blueprint(
|
110
|
+
tile_getter = TileGetter(config.map_tile_url)
|
111
|
+
image_transforms = {
|
112
|
+
"color": IdentityImageTransform(),
|
113
|
+
"grayscale": GrayscaleImageTransform(),
|
114
|
+
"pastel": PastelImageTransform(),
|
115
|
+
}
|
116
|
+
flasher = FlaskFlasher()
|
117
|
+
heart_rate_zone_computer = HeartRateZoneComputer(config)
|
118
|
+
|
119
|
+
register_entry_views(app, repository, config)
|
120
|
+
|
121
|
+
blueprints = {
|
122
|
+
"/activity": make_activity_blueprint(
|
123
|
+
repository,
|
124
|
+
authenticator,
|
125
|
+
tile_visit_accessor,
|
126
|
+
config,
|
127
|
+
heart_rate_zone_computer,
|
128
|
+
),
|
129
|
+
"/auth": make_auth_blueprint(authenticator),
|
130
|
+
"/bubble-chart": make_bubble_chart_blueprint(repository),
|
131
|
+
"/calendar": make_calendar_blueprint(repository),
|
132
|
+
"/eddington": register_eddington_blueprint(repository, search_query_history),
|
133
|
+
"/equipment": make_equipment_blueprint(repository, config),
|
134
|
+
"/explorer": make_explorer_blueprint(
|
135
|
+
authenticator, repository, tile_visit_accessor, config_accessor
|
136
|
+
),
|
137
|
+
"/heatmap": make_heatmap_blueprint(
|
116
138
|
repository, tile_visit_accessor, config_accessor(), search_query_history
|
117
139
|
),
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
make_settings_blueprint(config_accessor, authenticator),
|
122
|
-
url_prefix="/settings",
|
123
|
-
)
|
124
|
-
app.register_blueprint(
|
125
|
-
make_square_planner_blueprint(tile_visit_accessor),
|
126
|
-
url_prefix="/square-planner",
|
127
|
-
)
|
128
|
-
app.register_blueprint(
|
129
|
-
make_search_blueprint(
|
140
|
+
"/settings": make_settings_blueprint(config_accessor, authenticator, flasher),
|
141
|
+
"/square-planner": make_square_planner_blueprint(tile_visit_accessor),
|
142
|
+
"/search": make_search_blueprint(
|
130
143
|
repository, search_query_history, authenticator, config_accessor
|
131
144
|
),
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
make_summary_blueprint(repository, config, search_query_history),
|
136
|
-
url_prefix="/summary",
|
137
|
-
)
|
138
|
-
|
139
|
-
app.register_blueprint(make_tile_blueprint(config), url_prefix="/tile")
|
140
|
-
app.register_blueprint(
|
141
|
-
make_upload_blueprint(
|
145
|
+
"/summary": make_summary_blueprint(repository, config, search_query_history),
|
146
|
+
"/tile": make_tile_blueprint(image_transforms, tile_getter),
|
147
|
+
"/upload": make_upload_blueprint(
|
142
148
|
repository, tile_visit_accessor, config_accessor(), authenticator
|
143
149
|
),
|
144
|
-
|
145
|
-
|
150
|
+
}
|
151
|
+
|
152
|
+
for url_prefix, blueprint in blueprints.items():
|
153
|
+
app.register_blueprint(blueprint, url_prefix=url_prefix)
|
146
154
|
|
147
155
|
base_dir = pathlib.Path("Open Street Map Tiles")
|
148
156
|
dir_for_source = base_dir / urllib.parse.quote_plus(config_accessor().map_tile_url)
|