Skip to content

Commit a95346b

Browse files
committed
[DATAVIC-559] replaced xloader wrapper with datapusher plus
1 parent 1e330f8 commit a95346b

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

ckanext/datavic_odp_theme/plugin.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from ckan import model, types
1111

1212
from ckanext.search_autocomplete.interfaces import ISearchAutocomplete
13-
from ckanext.xloader.plugin import xloaderPlugin
13+
from ckanext.datapusher_plus.plugin import DatapusherPlusPlugin
1414

1515
from ckanext.datavic_odp_theme.logic import auth_functions, actions, get_validators
1616
from ckanext.datavic_odp_theme.views import get_blueprints
@@ -183,7 +183,7 @@ class DatavicODPThemeAuth(p.SingletonPlugin):
183183
pass
184184

185185

186-
class DatavicXLoaderPlugin(xloaderPlugin, p.SingletonPlugin):
186+
class DatavicDatapusherPlusPlugin(DatapusherPlusPlugin, p.SingletonPlugin):
187187
p.implements(p.IPackageController, inherit=True)
188188

189189
# IPackageController
@@ -212,11 +212,11 @@ def after_dataset_update(self, context, pkg_dict):
212212
group.add_package_by_name(pkg_dict.get('name'))
213213

214214
def _submit_new_resources_only(self, pkg_dict):
215-
"""Submit only newly added resources to xloader during dataset update.
215+
"""Submit only newly added resources to datapusher during dataset update.
216216
217217
Compares current resource IDs against the previous activity snapshot
218218
to detect new resources. URL changes for existing resources are
219-
handled by the parent xloaderPlugin via ``notify()``.
219+
handled by the parent DatapusherPlusPlugin via ``notify()``.
220220
221221
Falls back to submitting all resources if no activity data is
222222
available (e.g. activity plugin disabled, data migration).
@@ -289,7 +289,7 @@ def _infer_format_and_submit(self, resource):
289289
resource["format"] = (
290290
url_without_params.split(".")[-1].lower()
291291
)
292-
self._submit_to_xloader(resource)
292+
self._submit_to_datapusher(resource)
293293

294294
def _trigger_after_resource_create(self, pkg_dict):
295295
"""Submit all resources after dataset creation.
@@ -300,15 +300,15 @@ def _trigger_after_resource_create(self, pkg_dict):
300300
for resource in pkg_dict.get("resources", []):
301301
self._infer_format_and_submit(resource)
302302

303-
def _submit_to_xloader(self, resource_dict):
303+
def _submit_to_datapusher(self, resource_dict):
304304
"""Wrapper that ensures ``url_type`` and ``format`` are present
305305
before calling the parent, as they may be missing for resources
306306
created inline via ``package_create``/``package_update``.
307307
"""
308-
resource_dict.setdefault("url_type", "datavic_xloader")
308+
resource_dict.setdefault("url_type", "datavic_datapusher")
309309
resource_dict.setdefault("format", "")
310310

311-
super()._submit_to_xloader(resource_dict)
311+
super()._submit_to_datapusher(resource_dict)
312312

313-
if resource_dict["url_type"] == "datavic_xloader":
313+
if resource_dict["url_type"] == "datavic_datapusher":
314314
resource_dict.pop("url_type")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
[ckan.plugins]
6464
datavic_odp_theme=ckanext.datavic_odp_theme.plugin:DatavicODPTheme
6565
datavic_odp_theme_auth=ckanext.datavic_odp_theme.plugin:DatavicODPThemeAuth
66-
datavic_odp_xloader=ckanext.datavic_odp_theme.plugin:DatavicXLoaderPlugin
66+
datavic_odp_datapusher_plus=ckanext.datavic_odp_theme.plugin:DatavicDatapusherPlusPlugin
6767
6868
[babel.extractors]
6969
ckan = ckan.lib.extract:extract_ckan

0 commit comments

Comments
 (0)