ckanext-versioned-tiledmap 2.3.2__tar.gz → 2.3.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 (76) hide show
  1. {ckanext_versioned_tiledmap-2.3.2/ckanext_versioned_tiledmap.egg-info → ckanext_versioned_tiledmap-2.3.3}/PKG-INFO +8 -4
  2. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/README.md +6 -2
  3. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/lib/helpers.py +5 -4
  4. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/lib/utils.py +4 -3
  5. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/lib/validators.py +5 -4
  6. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/plugin.py +7 -4
  7. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/routes/_helpers.py +20 -17
  8. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/routes/map.py +1 -1
  9. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/less/maps.less +8 -2
  10. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3/ckanext_versioned_tiledmap.egg-info}/PKG-INFO +8 -4
  11. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext_versioned_tiledmap.egg-info/requires.txt +1 -1
  12. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/docs/_scripts/gen_api_pages.py +0 -1
  13. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/pyproject.toml +6 -7
  14. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/tests/test_helpers.py +1 -1
  15. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/tests/test_route_helpers.py +1 -1
  16. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/tests/test_utils.py +2 -1
  17. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/tests/test_validators.py +3 -1
  18. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/LICENSE +0 -0
  19. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/__init__.py +0 -0
  20. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/__init__.py +0 -0
  21. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/config.py +0 -0
  22. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/lib/__init__.py +0 -0
  23. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/routes/__init__.py +0 -0
  24. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/scripts/ckanfilterurl.js +0 -0
  25. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/scripts/drawshape_control.js +0 -0
  26. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/scripts/fullscreen_control.js +0 -0
  27. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/scripts/map_view.js +0 -0
  28. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/scripts/maptype_control.js +0 -0
  29. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/scripts/minimap_control.js +0 -0
  30. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/scripts/pointinfo_plugin.js +0 -0
  31. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/scripts/sidebar_view.js +0 -0
  32. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/scripts/tiledmap_module.js +0 -0
  33. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/scripts/tooltip_plugin.js +0 -0
  34. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/backbone/1.0.0/backbone.js +0 -0
  35. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/jquery/1.7.1/jquery.js +0 -0
  36. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/jquery/1.7.1/jquery.min.js +0 -0
  37. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/leaflet/leaflet-src.js +0 -0
  38. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/leaflet/leaflet.css +0 -0
  39. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/leaflet/leaflet.js +0 -0
  40. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/leaflet.draw/leaflet.draw-src.js +0 -0
  41. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/leaflet.draw/leaflet.draw.css +0 -0
  42. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/leaflet.minimap/Control.MiniMap.css +0 -0
  43. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/leaflet.minimap/Control.MiniMap.js +0 -0
  44. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/leaflet.minimap/LICENSE.txt +0 -0
  45. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/leaflet.minimap/readme.md +0 -0
  46. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/leaflet.utfgrid/leaflet.utfgrid.js +0 -0
  47. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/leaflet.utfgrid/leaflet.utfgrid.queue.js +0 -0
  48. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/mustache/0.5.0-dev/mustache.js +0 -0
  49. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/mustache/0.5.0-dev/mustache.min.js +0 -0
  50. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/terraformer/terraformer-wkt-parser.js +0 -0
  51. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/terraformer/terraformer.js +0 -0
  52. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/underscore/1.4.2/underscore.js +0 -0
  53. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/vendor/underscore/1.4.2/underscore.min.js +0 -0
  54. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/assets/webassets.yml +0 -0
  55. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/public/data/countries.geojson +0 -0
  56. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/public/vendor/leaflet/leaflet/layers-2x.png +0 -0
  57. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/public/vendor/leaflet/leaflet/layers.png +0 -0
  58. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/public/vendor/leaflet/leaflet/marker-icon-2x.png +0 -0
  59. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/public/vendor/leaflet/leaflet/marker-icon.png +0 -0
  60. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/public/vendor/leaflet/leaflet/marker-shadow.png +0 -0
  61. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/public/vendor/leaflet/leaflet.draw/spritesheet-2x.png +0 -0
  62. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/public/vendor/leaflet/leaflet.draw/spritesheet.png +0 -0
  63. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/public/vendor/leaflet/leaflet.minimap/toggle.png +0 -0
  64. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/templates/map_form.html +0 -0
  65. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/templates/map_view.html +0 -0
  66. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/templates/point_detail.dwc.mustache +0 -0
  67. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/templates/point_detail.mustache +0 -0
  68. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/templates/point_detail_hover.dwc.mustache +0 -0
  69. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext/tiledmap/theme/templates/point_detail_hover.mustache +0 -0
  70. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext_versioned_tiledmap.egg-info/SOURCES.txt +0 -0
  71. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext_versioned_tiledmap.egg-info/dependency_links.txt +0 -0
  72. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext_versioned_tiledmap.egg-info/entry_points.txt +0 -0
  73. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext_versioned_tiledmap.egg-info/not-zip-safe +0 -0
  74. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/ckanext_versioned_tiledmap.egg-info/top_level.txt +0 -0
  75. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/setup.cfg +0 -0
  76. {ckanext_versioned_tiledmap-2.3.2 → ckanext_versioned_tiledmap-2.3.3}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ckanext-versioned-tiledmap
3
- Version: 2.3.2
3
+ Version: 2.3.3
4
4
  Summary: A CKAN extension with a map view for versioned-datastore backed resources.
5
5
  Author-email: Natural History Museum <data@nhm.ac.uk>
6
6
  License: GPL-3.0-or-later
@@ -18,8 +18,8 @@ Requires-Python: >=3.6
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
20
  Requires-Dist: ckanext-versioned-datastore>=3.7.0
21
- Requires-Dist: ckantools>=0.3.0
22
21
  Requires-Dist: cachetools>=4.2.4
22
+ Requires-Dist: ckantools>=0.4.1
23
23
  Provides-Extra: test
24
24
  Requires-Dist: mock; extra == "test"
25
25
  Requires-Dist: pytest>=4.6.5; extra == "test"
@@ -27,11 +27,15 @@ Requires-Dist: pytest-cov>=2.7.1; extra == "test"
27
27
  Requires-Dist: coveralls; extra == "test"
28
28
 
29
29
  <!--header-start-->
30
- <img src="https://data.nhm.ac.uk/images/nhm_logo.svg" align="left" width="150px" height="100px" hspace="40"/>
30
+ <picture>
31
+ <source media="(prefers-color-scheme: dark)" srcset="https://data.nhm.ac.uk/images/nhm_logo.svg">
32
+ <source media="(prefers-color-scheme: light)" srcset="https://data.nhm.ac.uk/images/nhm_logo_black.svg">
33
+ <img alt="The Natural History Museum logo." src="https://data.nhm.ac.uk/images/nhm_logo_black.svg" align="left" width="150px" height="100px" hspace="40">
34
+ </picture>
31
35
 
32
36
  # ckanext-versioned-tiledmap
33
37
 
34
- [![Tests](https://img.shields.io/github/actions/workflow/status/NaturalHistoryMuseum/ckanext-versioned-tiledmap/main.yml?style=flat-square)](https://github.com/NaturalHistoryMuseum/ckanext-versioned-tiledmap/actions/workflows/main.yml)
38
+ [![Tests](https://img.shields.io/github/actions/workflow/status/NaturalHistoryMuseum/ckanext-versioned-tiledmap/tests.yml?style=flat-square)](https://github.com/NaturalHistoryMuseum/ckanext-versioned-tiledmap/actions/workflows/tests.yml)
35
39
  [![Coveralls](https://img.shields.io/coveralls/github/NaturalHistoryMuseum/ckanext-versioned-tiledmap/main?style=flat-square)](https://coveralls.io/github/NaturalHistoryMuseum/ckanext-versioned-tiledmap)
36
40
  [![CKAN](https://img.shields.io/badge/ckan-2.9.7-orange.svg?style=flat-square)](https://github.com/ckan/ckan)
37
41
  [![Python](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8-blue.svg?style=flat-square)](https://www.python.org/)
@@ -1,9 +1,13 @@
1
1
  <!--header-start-->
2
- <img src="https://data.nhm.ac.uk/images/nhm_logo.svg" align="left" width="150px" height="100px" hspace="40"/>
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://data.nhm.ac.uk/images/nhm_logo.svg">
4
+ <source media="(prefers-color-scheme: light)" srcset="https://data.nhm.ac.uk/images/nhm_logo_black.svg">
5
+ <img alt="The Natural History Museum logo." src="https://data.nhm.ac.uk/images/nhm_logo_black.svg" align="left" width="150px" height="100px" hspace="40">
6
+ </picture>
3
7
 
4
8
  # ckanext-versioned-tiledmap
5
9
 
6
- [![Tests](https://img.shields.io/github/actions/workflow/status/NaturalHistoryMuseum/ckanext-versioned-tiledmap/main.yml?style=flat-square)](https://github.com/NaturalHistoryMuseum/ckanext-versioned-tiledmap/actions/workflows/main.yml)
10
+ [![Tests](https://img.shields.io/github/actions/workflow/status/NaturalHistoryMuseum/ckanext-versioned-tiledmap/tests.yml?style=flat-square)](https://github.com/NaturalHistoryMuseum/ckanext-versioned-tiledmap/actions/workflows/tests.yml)
7
11
  [![Coveralls](https://img.shields.io/coveralls/github/NaturalHistoryMuseum/ckanext-versioned-tiledmap/main?style=flat-square)](https://coveralls.io/github/NaturalHistoryMuseum/ckanext-versioned-tiledmap)
8
12
  [![CKAN](https://img.shields.io/badge/ckan-2.9.7-orange.svg?style=flat-square)](https://github.com/ckan/ckan)
9
13
  [![Python](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8-blue.svg?style=flat-square)](https://www.python.org/)
@@ -12,11 +12,12 @@ def mustache_wrapper(s):
12
12
 
13
13
 
14
14
  def dwc_field_title(field):
15
- '''
15
+ """
16
16
  Convert a DwC field name into a label - split on uppercase
17
- @param field:
18
- @return: str label
19
- '''
17
+
18
+ :param field:
19
+ :returns: str label
20
+ """
20
21
  title = re.sub('([A-Z]+)', r' \1', field)
21
22
  title = f'{title[0].upper()}{title[1:]}'
22
23
  return title
@@ -4,9 +4,10 @@
4
4
  # This file is part of a project
5
5
  # Created by the Natural History Museum in London, UK
6
6
 
7
- from ckan.plugins import toolkit
8
7
  import urllib.request
9
- from cachetools import cached, TTLCache
8
+
9
+ from cachetools import TTLCache, cached
10
+ from ckan.plugins import toolkit
10
11
 
11
12
 
12
13
  def get_resource_datastore_fields(resource_id):
@@ -32,4 +33,4 @@ def get_tileserver_status():
32
33
  else:
33
34
  tileserver_response_text = 'unavailable'
34
35
 
35
- return tileserver_response_text
36
+ return tileserver_response_text
@@ -7,6 +7,7 @@
7
7
  import re
8
8
 
9
9
  from ckan.plugins import toolkit
10
+
10
11
  from ckanext.tiledmap.lib.utils import get_resource_datastore_fields
11
12
 
12
13
 
@@ -16,7 +17,7 @@ def colour_validator(value, context):
16
17
 
17
18
  :param value: the value to validate
18
19
  :param context: the context within which this validation is taking place
19
- :return: the validated value
20
+ :returns: the validated value
20
21
  """
21
22
  if re.match('^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$', value):
22
23
  if value[0] != '#':
@@ -38,7 +39,7 @@ def float_01_validator(value, context):
38
39
 
39
40
  :param value: the value
40
41
  :param context: the context within which this validation is taking place
41
- :return: the validated value
42
+ :returns: the validated value
42
43
  """
43
44
  try:
44
45
  value = float(value)
@@ -55,7 +56,7 @@ def is_datastore_field(value, context):
55
56
 
56
57
  :param value: the value to validate
57
58
  :param context: the context within which this validation is taking place
58
- :return: the value
59
+ :returns: the value
59
60
  """
60
61
  passed_fields = value if isinstance(value, list) else [value]
61
62
  fields = get_resource_datastore_fields(toolkit.g.resource['id'])
@@ -71,7 +72,7 @@ def is_view_id(value, context):
71
72
 
72
73
  :param value: the value to validate
73
74
  :param context: the context within which this validation is taking place
74
- :return: the value
75
+ :returns: the value
75
76
  """
76
77
  if value:
77
78
  data = {'id': toolkit.g.resource['id']}
@@ -4,15 +4,18 @@
4
4
  # This file is part of a project
5
5
  # Created by the Natural History Museum in London, UK
6
6
 
7
+
7
8
  from ckan.common import json
8
- from ckan.plugins import toolkit, implements, interfaces, SingletonPlugin
9
+ from ckan.plugins import SingletonPlugin, implements, interfaces, toolkit
9
10
 
10
11
  from ckanext.tiledmap import routes
11
12
  from ckanext.tiledmap.config import config as plugin_config
12
13
  from ckanext.tiledmap.lib import validators
13
- from ckanext.tiledmap.lib.helpers import mustache_wrapper, dwc_field_title
14
- from ckanext.tiledmap.lib.utils import get_resource_datastore_fields, get_tileserver_status
15
- import urllib.request
14
+ from ckanext.tiledmap.lib.helpers import dwc_field_title, mustache_wrapper
15
+ from ckanext.tiledmap.lib.utils import (
16
+ get_resource_datastore_fields,
17
+ get_tileserver_status,
18
+ )
16
19
 
17
20
  try:
18
21
  from ckanext.status.interfaces import IStatus
@@ -12,6 +12,7 @@ from urllib.parse import unquote
12
12
 
13
13
  from ckan.common import json
14
14
  from ckan.plugins import toolkit
15
+
15
16
  from ckanext.tiledmap.config import config
16
17
 
17
18
 
@@ -21,12 +22,12 @@ class MapViewSettings:
21
22
  """
22
23
 
23
24
  def __init__(self, fetch_id, view, resource):
24
- '''
25
+ """
25
26
  :param fetch_id: the id of the request, as provided by the javascript module. This is used
26
27
  to keep track on the javascript side of the order map-info requests.
27
28
  :param view: the view dict
28
29
  :param resource: the resource dict
29
- '''
30
+ """
30
31
  self.fetch_id = fetch_id
31
32
  self.view = view
32
33
  self.resource = resource
@@ -73,7 +74,7 @@ class MapViewSettings:
73
74
  Returns True if at least one of the map styles (plot, grid, heat) is enabled. If
74
75
  none of them are, returns False.
75
76
 
76
- :return: True if one map style is enabled, False if none are
77
+ :returns: True if one map style is enabled, False if none are
77
78
  """
78
79
  return self.plot_map_enabled or self.grid_map_enabled or self.heat_map_enabled
79
80
 
@@ -85,7 +86,7 @@ class MapViewSettings:
85
86
 
86
87
  :param name: the name of the template
87
88
  :param extra_vars: a dict of variables to pass to the template renderer
88
- :return: a rendered template
89
+ :returns: a rendered template
89
90
  """
90
91
  # this is the base name of the template, if there's no format version available then we'll
91
92
  # just return this
@@ -105,7 +106,7 @@ class MapViewSettings:
105
106
  """
106
107
  Renders the point info template and returns the result.
107
108
 
108
- :return: the rendered point info template
109
+ :returns: the rendered point info template
109
110
  """
110
111
  return self._render_template(
111
112
  config['versioned_tilemap.info_template'],
@@ -120,7 +121,7 @@ class MapViewSettings:
120
121
  """
121
122
  Renders the point hover info template and returns the result.
122
123
 
123
- :return: the rendered point hover info template
124
+ :returns: the rendered point hover info template
124
125
  """
125
126
  return self._render_template(
126
127
  config['versioned_tilemap.quick_info_template'],
@@ -137,9 +138,9 @@ class MapViewSettings:
137
138
  retrieved from the config object.
138
139
 
139
140
  :param style: the name of the style (plot, gridded or heatmap)
140
- :param names: the names of the parameters to retrieve, these are also used as the names in
141
- the dict that the parameter values are stored under
142
- :return: a dict
141
+ :param names: the names of the parameters to retrieve, these are also used as
142
+ the names in the dict that the parameter values are stored under
143
+ :returns: a dict
143
144
  """
144
145
  params = {}
145
146
  for name in names:
@@ -161,7 +162,7 @@ class MapViewSettings:
161
162
  (e.g. [[0, 4], [70, 71]]). This is how it is returned by the datastore_query_extent
162
163
  action.
163
164
 
164
- :return: a 3-tuple - (int, int, list)
165
+ :returns: a 3-tuple - (int, int, list)
165
166
  """
166
167
  q, filters = extract_q_and_filters()
167
168
  # get query extent and counts
@@ -199,7 +200,7 @@ class MapViewSettings:
199
200
  - the query body is then sent along with all tile requests to the tile server, which
200
201
  decompresses it and uses it to search elasticsearch
201
202
 
202
- :return: a url safe base64 encoded, gzipped, JSON string
203
+ :returns: a url safe base64 encoded, gzipped, JSON string
203
204
  """
204
205
  q, filters = extract_q_and_filters()
205
206
  result = toolkit.get_action('datastore_search')(
@@ -220,7 +221,7 @@ class MapViewSettings:
220
221
  Using the settings available on this object, create the /map-info response dict
221
222
  and return it.
222
223
 
223
- :return: a dict
224
+ :returns: a dict
224
225
  """
225
226
  # get the standard map info dict (this provides a fresh one each time it's called)
226
227
  map_info = get_base_map_info()
@@ -324,7 +325,7 @@ def build_url(*parts):
324
325
  Given a bunch of parts, build a URL by joining them together with a /.
325
326
 
326
327
  :param parts: the URL parts
327
- :return: a URL string
328
+ :returns: a URL string
328
329
  """
329
330
  return '/'.join(part.strip('/') for part in parts)
330
331
 
@@ -334,7 +335,8 @@ def extract_q_and_filters():
334
335
  Extract the q and filters query string parameters from the request. These are
335
336
  standard parameters in the resource views and have a standardised format too.
336
337
 
337
- :return: a 2-tuple of the q value (string, or None) and the filters value (dict, or None)
338
+ :returns: a 2-tuple of the q value (string, or None) and the filters value (dict, or
339
+ None)
338
340
  """
339
341
  # get the query if there is one
340
342
  q = (
@@ -364,10 +366,11 @@ def get_base_map_info():
364
366
  running CKAN instance (they use either always static values or ones that are pulled
365
367
  from the config which can are set on boot).
366
368
 
367
- A few settings are missing, these are set in MapViewSettings.create_map_info as they require
368
- custom per-map settings that the user has control over or are dependant on the target resource.
369
+ A few settings are missing, these are set in MapViewSettings.create_map_info as they
370
+ require custom per-map settings that the user has control over or are dependant on
371
+ the target resource.
369
372
 
370
- :return: a dict of settings
373
+ :returns: a dict of settings
371
374
  """
372
375
  png_url = build_url(config['versioned_tilemap.tile_server'], '/{z}/{x}/{y}.png')
373
376
  utf_grid_url = build_url(
@@ -16,7 +16,7 @@ def info():
16
16
  """
17
17
  Returns metadata about a given map in JSON form.
18
18
 
19
- :return: A JSON encoded string representing the metadata
19
+ :returns: A JSON encoded string representing the metadata
20
20
  """
21
21
  view_settings = _helpers.MapViewSettings.from_request()
22
22
 
@@ -51,7 +51,10 @@ div.tiled-map-info {
51
51
  .info {
52
52
  color: #555;
53
53
  padding: 6px 8px;
54
- font: 14px/16px Arial, Helvetica, sans-serif;
54
+ font:
55
+ 14px/16px Arial,
56
+ Helvetica,
57
+ sans-serif;
55
58
  background: rgba(255, 255, 255, 0.95);
56
59
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
57
60
  border-radius: 10px;
@@ -62,7 +65,10 @@ div.tiled-map-info {
62
65
  .small-info {
63
66
  color: #555;
64
67
  padding: 6px 8px;
65
- font: 14px/16px Arial, Helvetica, sans-serif;
68
+ font:
69
+ 14px/16px Arial,
70
+ Helvetica,
71
+ sans-serif;
66
72
  background: rgba(255, 255, 255, 0.95);
67
73
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
68
74
  border-radius: 10px;
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ckanext-versioned-tiledmap
3
- Version: 2.3.2
3
+ Version: 2.3.3
4
4
  Summary: A CKAN extension with a map view for versioned-datastore backed resources.
5
5
  Author-email: Natural History Museum <data@nhm.ac.uk>
6
6
  License: GPL-3.0-or-later
@@ -18,8 +18,8 @@ Requires-Python: >=3.6
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
20
  Requires-Dist: ckanext-versioned-datastore>=3.7.0
21
- Requires-Dist: ckantools>=0.3.0
22
21
  Requires-Dist: cachetools>=4.2.4
22
+ Requires-Dist: ckantools>=0.4.1
23
23
  Provides-Extra: test
24
24
  Requires-Dist: mock; extra == "test"
25
25
  Requires-Dist: pytest>=4.6.5; extra == "test"
@@ -27,11 +27,15 @@ Requires-Dist: pytest-cov>=2.7.1; extra == "test"
27
27
  Requires-Dist: coveralls; extra == "test"
28
28
 
29
29
  <!--header-start-->
30
- <img src="https://data.nhm.ac.uk/images/nhm_logo.svg" align="left" width="150px" height="100px" hspace="40"/>
30
+ <picture>
31
+ <source media="(prefers-color-scheme: dark)" srcset="https://data.nhm.ac.uk/images/nhm_logo.svg">
32
+ <source media="(prefers-color-scheme: light)" srcset="https://data.nhm.ac.uk/images/nhm_logo_black.svg">
33
+ <img alt="The Natural History Museum logo." src="https://data.nhm.ac.uk/images/nhm_logo_black.svg" align="left" width="150px" height="100px" hspace="40">
34
+ </picture>
31
35
 
32
36
  # ckanext-versioned-tiledmap
33
37
 
34
- [![Tests](https://img.shields.io/github/actions/workflow/status/NaturalHistoryMuseum/ckanext-versioned-tiledmap/main.yml?style=flat-square)](https://github.com/NaturalHistoryMuseum/ckanext-versioned-tiledmap/actions/workflows/main.yml)
38
+ [![Tests](https://img.shields.io/github/actions/workflow/status/NaturalHistoryMuseum/ckanext-versioned-tiledmap/tests.yml?style=flat-square)](https://github.com/NaturalHistoryMuseum/ckanext-versioned-tiledmap/actions/workflows/tests.yml)
35
39
  [![Coveralls](https://img.shields.io/coveralls/github/NaturalHistoryMuseum/ckanext-versioned-tiledmap/main?style=flat-square)](https://coveralls.io/github/NaturalHistoryMuseum/ckanext-versioned-tiledmap)
36
40
  [![CKAN](https://img.shields.io/badge/ckan-2.9.7-orange.svg?style=flat-square)](https://github.com/ckan/ckan)
37
41
  [![Python](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8-blue.svg?style=flat-square)](https://www.python.org/)
@@ -1,6 +1,6 @@
1
1
  ckanext-versioned-datastore>=3.7.0
2
- ckantools>=0.3.0
3
2
  cachetools>=4.2.4
3
+ ckantools>=0.4.1
4
4
 
5
5
  [test]
6
6
  mock
@@ -1,6 +1,5 @@
1
1
  # !/usr/bin/env python
2
2
  # encoding: utf-8
3
-
4
3
  """
5
4
  Generate the code reference pages and navigation.
6
5
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ckanext-versioned-tiledmap"
3
- version = "2.3.2"
3
+ version = "2.3.3"
4
4
  description = "A CKAN extension with a map view for versioned-datastore backed resources."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.6"
@@ -20,8 +20,8 @@ classifiers = [
20
20
  ]
21
21
  dependencies = [
22
22
  "ckanext-versioned-datastore>=3.7.0",
23
- "ckantools>=0.3.0",
24
- "cachetools>=4.2.4"
23
+ "cachetools>=4.2.4",
24
+ "ckantools>=0.4.1"
25
25
  ]
26
26
 
27
27
  [project.optional-dependencies]
@@ -57,7 +57,7 @@ exclude = ["tests", "docs"]
57
57
 
58
58
  [tool.commitizen]
59
59
  name = "cz_nhm"
60
- version = "2.3.2"
60
+ version = "2.3.3"
61
61
  tag_format = "v$version"
62
62
  update_changelog_on_bump = true
63
63
  changelog_incremental = true
@@ -66,9 +66,8 @@ version_files = [
66
66
  "CITATION.cff:^version"
67
67
  ]
68
68
 
69
- [tool.black]
70
- line-length = 88
71
- skip_string_normalization = true
69
+ [tool.ruff.format]
70
+ quote-style = "single"
72
71
 
73
72
  [tool.pylint]
74
73
  max-line-length = 88
@@ -1,4 +1,4 @@
1
- from ckanext.tiledmap.lib.helpers import mustache_wrapper, dwc_field_title
1
+ from ckanext.tiledmap.lib.helpers import dwc_field_title, mustache_wrapper
2
2
 
3
3
 
4
4
  def test_mustache_wrapper():
@@ -1,5 +1,5 @@
1
1
  from functools import wraps
2
- from unittest.mock import patch, MagicMock
2
+ from unittest.mock import MagicMock, patch
3
3
 
4
4
  from ckanext.tiledmap.routes._helpers import extract_q_and_filters
5
5
 
@@ -1,5 +1,6 @@
1
+ from unittest.mock import MagicMock, patch
2
+
1
3
  from ckanext.tiledmap.lib.utils import get_resource_datastore_fields
2
- from unittest.mock import patch, MagicMock
3
4
 
4
5
 
5
6
  def test_get_resource_datastore_fields():
@@ -1,12 +1,14 @@
1
+ from unittest.mock import MagicMock, patch
2
+
1
3
  import pytest
2
4
  from ckan.plugins import toolkit
5
+
3
6
  from ckanext.tiledmap.lib.validators import (
4
7
  colour_validator,
5
8
  float_01_validator,
6
9
  is_datastore_field,
7
10
  is_view_id,
8
11
  )
9
- from unittest.mock import MagicMock, patch
10
12
 
11
13
 
12
14
  def test_colour_validator():