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

65-migrate Ckan2.9/py3 #67

Open
wants to merge 2 commits into
base: dcatapit
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ckanext/provbz/harvesters/harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ def after_import_stage(self, package_dict):
self.persist_package_multilang_field(package_id, 'publisher_name', publisher.get('text'), publisher.get('locale'), 'extra')

pass
except Exception, e:
except Exception as e:
log.error('Exception occurred while persisting DB objects: %s', e)
raise

Expand Down
6 changes: 3 additions & 3 deletions ckanext/provbz/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
import ckan.logic as logic
from ckan.common import request

from pylons import config
from ckan.plugins.toolkit import config

from ckan.lib.i18n import get_lang
from ckanext.multilang.model import PackageMultilang, TagMultilang

import ckanext.pages.db as db

from HTMLParser import HTMLParser
from html.parser import HTMLParser


log = logging.getLogger(__file__)
Expand Down Expand Up @@ -102,7 +102,7 @@ def recent_updates(n):

try:
search_results = logic.get_action('package_search')(context, data_dict)
except search.SearchError, e:
except search.SearchError as e:
log.error('Error searching for recently updated datasets')
log.error(e)
search_results = {}
Expand Down
3 changes: 2 additions & 1 deletion ckanext/provbz/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def get_custom_schema(self):
def update_config(self, config):
toolkit.add_template_directory(config, 'templates')
toolkit.add_public_directory(config, 'public')
toolkit.add_resource('public/base', 'ckanext-provbz')
toolkit.add_resource('public/base', 'ckanext-provbz') # path, webasset name
toolkit.add_public_directory(config, 'public/base')

# Implementation of ITemplateHelpers
# ------------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions ckanext/provbz/public/webassets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
provbz-homepage-js:
contents:
- base/base.js
filters: rjsmin
output: provbz/%(version)s_homepage.js
8 changes: 4 additions & 4 deletions ckanext/provbz/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ <h2>A sidebar item</h2>
{%- endblock -%}

{%- block scripts %}
{% resource 'base/main' %}
{% asset 'base/main' %}

{% resource 'base/ckan' %}
{% asset 'base/ckan' %}

{% if g.tracking_enabled %}
{% resource 'base/tracking.js' %}
{% asset 'base/tracking.js' %}
{% endif %}

{% resource 'ckanext-provbz/main' %}
{% asset 'ckanext-provbz/provbz-homepage-js' %}

{{ super() }}
{% endblock -%}
Expand Down
4 changes: 2 additions & 2 deletions ckanext/provbz/templates/snippets/package_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

{% block package_item %}
<li class="{{ item_class or "dataset-item" }}">
<div class="package-item-clickable" onClick="location.href='{{ h.url_for(controller='package', action='read', id=package.name) }}'">
<div class="package-item-clickable" onClick="location.href='{{ h.url_for(controller='dataset', action='read', id=package.name) }}'">
{% block content %}
<div class="dataset-content">
{% block heading %}
Expand All @@ -43,7 +43,7 @@ <h3 class="dataset-heading">
{% endif %}
{% endblock %}
{% block heading_title %}
{{ h.link_to(h.truncate(title, truncate_title), h.url_for(controller='package', action='read', id=package.name)) }}
{{ h.link_to(h.truncate(title, truncate_title), h.url_for(controller='dataset', action='read', id=package.name)) }}
{% endblock %}
{% block heading_meta %}
{% if package.get('state', '').startswith('draft') %}
Expand Down