Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compatibility with CKAN2.9 #7

Open
andrecastro0o opened this issue Nov 3, 2020 · 1 comment
Open

compatibility with CKAN2.9 #7

andrecastro0o opened this issue Nov 3, 2020 · 1 comment

Comments

@andrecastro0o
Copy link

How is the state of ckanext-datasetthumbnail on CKAN 2.9?

After going to the installation process and activating in ckan.plugins when I run CKAN
(default) $ ckan -c /etc/ckan/default/ckan.ini

I first got an error for missing pylons, which I pip installed.

And trying to run it, results in

2020-11-03 09:32:23,425 INFO  [ckan.cli] Using configuration file /etc/ckan/default/ckan.ini
2020-11-03 09:32:23,425 INFO  [ckan.config.environment] Loading static files from public
2020-11-03 09:32:23,451 INFO  [ckan.config.environment] Loading templates from /usr/lib/ckan/default/src/ckan/ckan/templates
Traceback (most recent call last):
  File "/usr/lib/ckan/default/bin/ckan", line 33, in <module>
    sys.exit(load_entry_point('ckan', 'console_scripts', 'ckan')())
  File "/usr/lib/ckan/default/lib/python3.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/ckan/default/lib/python3.7/site-packages/click/core.py", line 696, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "/usr/lib/ckan/default/lib/python3.7/site-packages/click/core.py", line 621, in make_context
    self.parse_args(ctx, args)
  File "/usr/lib/ckan/default/lib/python3.7/site-packages/click/core.py", line 1018, in parse_args
    rest = Command.parse_args(self, ctx, args)
  File "/usr/lib/ckan/default/lib/python3.7/site-packages/click/core.py", line 880, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/usr/lib/ckan/default/lib/python3.7/site-packages/click/core.py", line 1404, in handle_parse_result
    self.callback, ctx, self, value)
  File "/usr/lib/ckan/default/lib/python3.7/site-packages/click/core.py", line 78, in invoke_param_callback
    return callback(ctx, param, value)
  File "/usr/lib/ckan/default/src/ckan/ckan/cli/cli.py", line 90, in _init_ckan_config
    ctx.obj = CkanCommand(value)
  File "/usr/lib/ckan/default/src/ckan/ckan/cli/cli.py", line 46, in __init__
    self.app = make_app(self.config)
  File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware/__init__.py", line 56, in make_app
    load_environment(conf)
  File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 123, in load_environment
    p.load_all()
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 140, in load_all
    load(*plugins)
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 154, in load
    service = _get_service(plugin)
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 256, in _get_service
    return plugin.load()(name=plugin_name)
  File "/usr/lib/ckan/default/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/usr/lib/ckan/default/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/ckan/default/lib/python3.7/site-packages/ckanext/datasetthumbnail/plugin.py", line 3, in <module>
    import pylons.config as config
  File "/usr/lib/ckan/default/lib/python3.7/site-packages/pylons/__init__.py", line 8, in <module>
    from pylons.controllers.util import Request
  File "/usr/lib/ckan/default/lib/python3.7/site-packages/pylons/controllers/__init__.py", line 2, in <module>
    from pylons.controllers.core import WSGIController
  File "/usr/lib/ckan/default/lib/python3.7/site-packages/pylons/controllers/core.py", line 108
    except HTTPException, httpe:
                        ^
SyntaxError: invalid syntax

Any ideas of why I am getting this error?

@martinburchell
Copy link
Contributor

We've not tried the plugin with CKAN 2.9 and haven't yet had the funding to update it.

My understanding is that later versions of CKAN use Flask, not Pylons. We're importing pylons.config on line 3 of plugin.py. I guess that needs to change to possibly from ckan.plugins.toolkit import config. There may well be other places where the code needs to change.

Pull requests welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants