geo-activity-playground 0.33.2__tar.gz → 0.33.3__tar.gz

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.
Files changed (117) hide show
  1. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/PKG-INFO +1 -1
  2. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/__main__.py +1 -1
  3. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/app.py +1 -1
  4. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/entry_controller.py +1 -1
  5. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/templates/home.html.j2 +3 -2
  6. geo_activity_playground-0.33.2/geo_activity_playground/webui/upload/controller.py → geo_activity_playground-0.33.3/geo_activity_playground/webui/upload_blueprint.py +40 -33
  7. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/pyproject.toml +1 -1
  8. geo_activity_playground-0.33.2/geo_activity_playground/webui/upload/__init__.py +0 -0
  9. geo_activity_playground-0.33.2/geo_activity_playground/webui/upload/blueprint.py +0 -44
  10. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/LICENSE +0 -0
  11. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/__init__.py +0 -0
  12. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/core/__init__.py +0 -0
  13. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/core/activities.py +0 -0
  14. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/core/config.py +0 -0
  15. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/core/coordinates.py +0 -0
  16. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/core/enrichment.py +0 -0
  17. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/core/heart_rate.py +0 -0
  18. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/core/heatmap.py +0 -0
  19. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/core/paths.py +0 -0
  20. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/core/privacy_zones.py +0 -0
  21. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/core/similarity.py +0 -0
  22. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/core/tasks.py +0 -0
  23. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/core/test_tiles.py +0 -0
  24. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/core/test_time_conversion.py +0 -0
  25. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/core/tiles.py +0 -0
  26. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/core/time_conversion.py +0 -0
  27. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/explorer/__init__.py +0 -0
  28. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/explorer/grid_file.py +0 -0
  29. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/explorer/tile_visits.py +0 -0
  30. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/explorer/video.py +0 -0
  31. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/importers/__init__.py +0 -0
  32. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/importers/activity_parsers.py +0 -0
  33. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/importers/csv_parser.py +0 -0
  34. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/importers/directory.py +0 -0
  35. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/importers/strava_api.py +0 -0
  36. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/importers/strava_checkout.py +0 -0
  37. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/importers/test_csv_parser.py +0 -0
  38. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/importers/test_directory.py +0 -0
  39. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/importers/test_strava_api.py +0 -0
  40. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/__init__.py +0 -0
  41. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/activity/__init__.py +0 -0
  42. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/activity/blueprint.py +0 -0
  43. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/activity/controller.py +0 -0
  44. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/activity/templates/activity/day.html.j2 +0 -0
  45. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/activity/templates/activity/edit.html.j2 +0 -0
  46. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/activity/templates/activity/lines.html.j2 +0 -0
  47. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/activity/templates/activity/name.html.j2 +0 -0
  48. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/activity/templates/activity/show.html.j2 +0 -0
  49. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/auth/blueprint.py +0 -0
  50. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/auth/templates/auth/index.html.j2 +0 -0
  51. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/authenticator.py +0 -0
  52. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/calendar/__init__.py +0 -0
  53. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/calendar/blueprint.py +0 -0
  54. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/calendar/controller.py +0 -0
  55. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/calendar/templates/calendar/index.html.j2 +0 -0
  56. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/calendar/templates/calendar/month.html.j2 +0 -0
  57. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/eddington/__init__.py +0 -0
  58. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/eddington/blueprint.py +0 -0
  59. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/eddington/controller.py +0 -0
  60. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/eddington/templates/eddington/index.html.j2 +0 -0
  61. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/equipment/__init__.py +0 -0
  62. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/equipment/blueprint.py +0 -0
  63. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/equipment/controller.py +0 -0
  64. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/equipment/templates/equipment/index.html.j2 +0 -0
  65. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/explorer/__init__.py +0 -0
  66. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/explorer/blueprint.py +0 -0
  67. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/explorer/controller.py +0 -0
  68. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/explorer/templates/explorer/index.html.j2 +0 -0
  69. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/heatmap/__init__.py +0 -0
  70. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/heatmap/blueprint.py +0 -0
  71. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/heatmap/heatmap_controller.py +0 -0
  72. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/heatmap/templates/heatmap/index.html.j2 +0 -0
  73. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/plot_util.py +0 -0
  74. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/search/blueprint.py +0 -0
  75. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/search/templates/search/index.html.j2 +0 -0
  76. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/settings/blueprint.py +0 -0
  77. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/settings/controller.py +0 -0
  78. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/settings/templates/settings/admin-password.html.j2 +0 -0
  79. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/settings/templates/settings/color-schemes.html.j2 +0 -0
  80. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/settings/templates/settings/equipment-offsets.html.j2 +0 -0
  81. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/settings/templates/settings/heart-rate.html.j2 +0 -0
  82. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/settings/templates/settings/index.html.j2 +0 -0
  83. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/settings/templates/settings/kind-renames.html.j2 +0 -0
  84. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/settings/templates/settings/kinds-without-achievements.html.j2 +0 -0
  85. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/settings/templates/settings/metadata-extraction.html.j2 +0 -0
  86. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/settings/templates/settings/privacy-zones.html.j2 +0 -0
  87. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/settings/templates/settings/segmentation.html.j2 +0 -0
  88. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/settings/templates/settings/sharepic.html.j2 +0 -0
  89. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/settings/templates/settings/strava.html.j2 +0 -0
  90. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/square_planner/__init__.py +0 -0
  91. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/square_planner/blueprint.py +0 -0
  92. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/square_planner/controller.py +0 -0
  93. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/square_planner/templates/square_planner/index.html.j2 +0 -0
  94. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/static/android-chrome-192x192.png +0 -0
  95. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/static/android-chrome-512x512.png +0 -0
  96. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/static/apple-touch-icon.png +0 -0
  97. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/static/bootstrap-dark-mode.js +0 -0
  98. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/static/browserconfig.xml +0 -0
  99. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/static/favicon-16x16.png +0 -0
  100. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/static/favicon-32x32.png +0 -0
  101. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/static/favicon-48x48.png +0 -0
  102. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/static/favicon.ico +0 -0
  103. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/static/favicon.svg +0 -0
  104. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/static/mstile-150x150.png +0 -0
  105. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/static/site.webmanifest +0 -0
  106. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/static/web-app-manifest-192x192.png +0 -0
  107. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/static/web-app-manifest-512x512.png +0 -0
  108. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/summary/__init__.py +0 -0
  109. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/summary/blueprint.py +0 -0
  110. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/summary/controller.py +0 -0
  111. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/summary/templates/summary/index.html.j2 +0 -0
  112. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/templates/page.html.j2 +0 -0
  113. {geo_activity_playground-0.33.2/geo_activity_playground/webui/upload → geo_activity_playground-0.33.3/geo_activity_playground/webui}/templates/upload/index.html.j2 +0 -0
  114. {geo_activity_playground-0.33.2/geo_activity_playground/webui/upload → geo_activity_playground-0.33.3/geo_activity_playground/webui}/templates/upload/reload.html.j2 +0 -0
  115. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/tile/__init__.py +0 -0
  116. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/tile/blueprint.py +0 -0
  117. {geo_activity_playground-0.33.2 → geo_activity_playground-0.33.3}/geo_activity_playground/webui/tile/controller.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: geo-activity-playground
3
- Version: 0.33.2
3
+ Version: 0.33.3
4
4
  Summary: Analysis of geo data activities like rides, runs or hikes.
5
5
  License: MIT
6
6
  Author: Martin Ueding
@@ -13,7 +13,7 @@ from geo_activity_playground.core.config import import_old_strava_config
13
13
  from geo_activity_playground.explorer.tile_visits import TileVisitAccessor
14
14
  from geo_activity_playground.explorer.video import explorer_video_main
15
15
  from geo_activity_playground.webui.app import web_ui_main
16
- from geo_activity_playground.webui.upload.controller import scan_for_activities
16
+ from geo_activity_playground.webui.upload_blueprint import scan_for_activities
17
17
 
18
18
  logger = logging.getLogger(__name__)
19
19
 
@@ -22,7 +22,7 @@ from .search.blueprint import make_search_blueprint
22
22
  from .square_planner.blueprint import make_square_planner_blueprint
23
23
  from .summary.blueprint import make_summary_blueprint
24
24
  from .tile.blueprint import make_tile_blueprint
25
- from .upload.blueprint import make_upload_blueprint
25
+ from .upload_blueprint import make_upload_blueprint
26
26
  from geo_activity_playground.core.config import Config
27
27
  from geo_activity_playground.core.config import ConfigAccessor
28
28
  from geo_activity_playground.webui.auth.blueprint import make_auth_blueprint
@@ -16,10 +16,10 @@ class EntryController:
16
16
  self._config = config
17
17
 
18
18
  def render(self) -> dict:
19
- kind_scale = make_kind_scale(self._repository.meta, self._config)
20
19
  result = {"latest_activities": []}
21
20
 
22
21
  if len(self._repository):
22
+ kind_scale = make_kind_scale(self._repository.meta, self._config)
23
23
  result["distance_last_30_days_plot"] = distance_last_30_days_meta_plot(
24
24
  self._repository.meta, kind_scale
25
25
  )
@@ -58,8 +58,9 @@
58
58
  </div>
59
59
  {% endfor %}
60
60
  {% else %}
61
- <p>You don't have activities yet. Either put some files into a directory <tt>Activities</tt> or <a
62
- href="{{ url_for('settings.strava') }}">set up Strava API</a>.</p>
61
+ <p>You don't have activities yet. Either put some files into a directory <tt>Activities</tt>, <a
62
+ href="{{ url_for('upload.index') }}">upload activities</a> or <a href="{{ url_for('settings.strava') }}">set up
63
+ Strava API</a>.</p>
63
64
  {% endif %}
64
65
 
65
66
  {% endblock %}
@@ -1,53 +1,51 @@
1
- import logging
2
1
  import os
3
2
  import pathlib
4
3
 
4
+ from flask import Blueprint
5
5
  from flask import flash
6
6
  from flask import redirect
7
+ from flask import render_template
7
8
  from flask import request
8
- from flask import Response
9
9
  from flask import url_for
10
- from werkzeug.utils import secure_filename
11
10
 
12
- from geo_activity_playground.core.activities import ActivityRepository
13
- from geo_activity_playground.core.activities import build_activity_meta
11
+ from ..core.activities import ActivityRepository
12
+ from ..core.activities import build_activity_meta
13
+ from ..explorer.tile_visits import compute_tile_evolution
14
+ from ..explorer.tile_visits import compute_tile_visits_new
15
+ from ..explorer.tile_visits import TileVisitAccessor
14
16
  from geo_activity_playground.core.config import Config
15
17
  from geo_activity_playground.core.enrichment import enrich_activities
16
- from geo_activity_playground.explorer.tile_visits import compute_tile_evolution
17
- from geo_activity_playground.explorer.tile_visits import compute_tile_visits_new
18
- from geo_activity_playground.explorer.tile_visits import TileVisitAccessor
19
18
  from geo_activity_playground.importers.directory import get_file_hash
20
19
  from geo_activity_playground.importers.directory import import_from_directory
21
20
  from geo_activity_playground.importers.strava_api import import_from_strava_api
22
21
  from geo_activity_playground.importers.strava_checkout import (
23
22
  import_from_strava_checkout,
24
23
  )
24
+ from geo_activity_playground.webui.authenticator import Authenticator
25
+ from geo_activity_playground.webui.authenticator import needs_authentication
25
26
 
26
27
 
27
- logger = logging.getLogger(__name__)
28
-
29
-
30
- class UploadController:
31
- def __init__(
32
- self,
33
- repository: ActivityRepository,
34
- tile_visit_accessor: TileVisitAccessor,
35
- config: Config,
36
- ) -> None:
37
- self._repository = repository
38
- self._tile_visit_accessor = tile_visit_accessor
39
- self._config = config
28
+ def make_upload_blueprint(
29
+ repository: ActivityRepository,
30
+ tile_visit_accessor: TileVisitAccessor,
31
+ config: Config,
32
+ authenticator: Authenticator,
33
+ ) -> Blueprint:
34
+ blueprint = Blueprint("upload", __name__, template_folder="templates")
40
35
 
41
- def render_form(self) -> dict:
36
+ @blueprint.route("/")
37
+ @needs_authentication(authenticator)
38
+ def index():
39
+ pathlib.Path("Activities").mkdir(exist_ok=True, parents=True)
42
40
  directories = []
43
41
  for root, dirs, files in os.walk("Activities"):
44
42
  directories.append(root)
45
43
  directories.sort()
46
- return {
47
- "directories": directories,
48
- }
44
+ return render_template("upload/index.html.j2", directories=directories)
49
45
 
50
- def receive(self) -> Response:
46
+ @blueprint.route("/receive", methods=["POST"])
47
+ @needs_authentication(authenticator)
48
+ def receive():
51
49
  # check if the post request has the file part
52
50
  if "file" not in request.files:
53
51
  flash("No file could be found. Did you select a file?", "warning")
@@ -74,25 +72,34 @@ class UploadController:
74
72
  assert target_path.is_relative_to("Activities")
75
73
  file.save(target_path)
76
74
  scan_for_activities(
77
- self._repository,
78
- self._tile_visit_accessor,
79
- self._config,
75
+ repository,
76
+ tile_visit_accessor,
77
+ config,
80
78
  skip_strava=True,
81
79
  )
82
80
  activity_id = get_file_hash(target_path)
83
81
  flash(f"Activity was saved with ID {activity_id}.", "success")
84
82
  return redirect(f"/activity/{activity_id}")
85
83
 
86
- def execute_reload(self) -> None:
84
+ @blueprint.route("/refresh")
85
+ @needs_authentication(authenticator)
86
+ def reload():
87
+ return render_template("upload/reload.html.j2")
88
+
89
+ @blueprint.route("/execute-reload")
90
+ @needs_authentication(authenticator)
91
+ def execute_reload():
87
92
  scan_for_activities(
88
- self._repository,
89
- self._tile_visit_accessor,
90
- self._config,
93
+ repository,
94
+ tile_visit_accessor,
95
+ config,
91
96
  skip_strava=True,
92
97
  )
93
98
  flash("Scanned for new activities.", category="success")
94
99
  return redirect(url_for("index"))
95
100
 
101
+ return blueprint
102
+
96
103
 
97
104
  def scan_for_activities(
98
105
  repository: ActivityRepository,
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "geo-activity-playground"
3
- version = "0.33.2"
3
+ version = "0.33.3"
4
4
  description = "Analysis of geo data activities like rides, runs or hikes."
5
5
  authors = ["Martin Ueding <mu@martin-ueding.de>"]
6
6
  license = "MIT"
@@ -1,44 +0,0 @@
1
- from flask import Blueprint
2
- from flask import render_template
3
-
4
- from ...core.activities import ActivityRepository
5
- from ...explorer.tile_visits import TileVisitAccessor
6
- from .controller import UploadController
7
- from geo_activity_playground.core.config import Config
8
- from geo_activity_playground.webui.authenticator import Authenticator
9
- from geo_activity_playground.webui.authenticator import needs_authentication
10
-
11
-
12
- def make_upload_blueprint(
13
- repository: ActivityRepository,
14
- tile_visit_accessor: TileVisitAccessor,
15
- config: Config,
16
- authenticator: Authenticator,
17
- ) -> Blueprint:
18
- blueprint = Blueprint("upload", __name__, template_folder="templates")
19
-
20
- upload_controller = UploadController(repository, tile_visit_accessor, config)
21
-
22
- @blueprint.route("/")
23
- @needs_authentication(authenticator)
24
- def index():
25
- return render_template(
26
- "upload/index.html.j2", **upload_controller.render_form()
27
- )
28
-
29
- @blueprint.route("/receive", methods=["POST"])
30
- @needs_authentication(authenticator)
31
- def receive():
32
- return upload_controller.receive()
33
-
34
- @blueprint.route("/refresh")
35
- @needs_authentication(authenticator)
36
- def reload():
37
- return render_template("upload/reload.html.j2")
38
-
39
- @blueprint.route("/execute-reload")
40
- @needs_authentication(authenticator)
41
- def execute_reload():
42
- return upload_controller.execute_reload()
43
-
44
- return blueprint