Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
LesterLyu committed May 30, 2024
1 parent 622d233 commit 3b4ed8a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 52 deletions.
16 changes: 0 additions & 16 deletions ckanext/udc_import_other_portals/logic/actions.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import logging
import json
from typing import Any, List, Dict
import traceback
import asyncio
import uuid

from ckanext.udc_import_other_portals.model import CUDCImportConfig, CUDCImportLog
from ckanext.udc_import_other_portals.jobs import job_run_import
Expand All @@ -14,7 +10,6 @@
import ckan.lib.jobs as jobs

from .base import BaseImport
from .utils import with_exit_stack


log = logging.getLogger(__name__)
Expand Down Expand Up @@ -183,17 +178,6 @@ def cudc_import_run(context: Context, data: Dict[str, Any]):
return {"success": True, "message": "Job submitted."}


@logic.side_effect_free
def cudc_import_status_get(context: Context, data: Dict[str, Any]):
"""
Get the previous or current import status.
"""
global import_instance
if import_instance:
return import_instance.get_status()
else:
return {"running": False, "message": "There is no previous import."}

@logic.side_effect_free
def cudc_import_logs_get(context: Context, data_dict):
"""
Expand Down
11 changes: 0 additions & 11 deletions ckanext/udc_import_other_portals/logic/utils.py

This file was deleted.

25 changes: 0 additions & 25 deletions ckanext/udc_import_other_portals/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
cudc_import_config_delete,
cudc_import_config_update,
cudc_import_run,
cudc_import_status_get,
cudc_import_logs_get,
cudc_import_log_delete,
)
Expand All @@ -19,7 +18,6 @@


class UdcImportOtherPortalsPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurable)
plugins.implements(plugins.IActions)

def configure(self, config: CKANConfig):
Expand All @@ -31,30 +29,7 @@ def get_actions(self) -> Dict[str, Action]:
"cudc_import_configs_get": cudc_import_configs_get,
"cudc_import_config_update": cudc_import_config_update,
"cudc_import_run": cudc_import_run,
"cudc_import_status_get": cudc_import_status_get,
"cudc_import_config_delete": cudc_import_config_delete,
"cudc_import_logs_get": cudc_import_logs_get,
"cudc_import_log_delete": cudc_import_log_delete,
}

# IConfigurable
def update_config_schema(self, schema: Schema):

ignore_missing = tk.get_validator("ignore_missing")
unicode_safe = tk.get_validator("unicode_safe")

schema.update(
{
"ckanext.udc_import_other_portals.side_panel_text": [
ignore_missing,
unicode_safe,
],
# This is a custom configuration option
"ckanext.udc_import_other_portals.import_configs": [
ignore_missing,
unicode_safe,
],
}
)

return schema

0 comments on commit 3b4ed8a

Please sign in to comment.