From e104e7eb9eb36fa20b37a74d6431e7b3080cc9c0 Mon Sep 17 00:00:00 2001 From: John Glover Date: Mon, 19 Dec 2011 09:51:25 +0000 Subject: [PATCH] update genshi code for latest dataset view changes --- ckanext/googleanalytics/plugin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ckanext/googleanalytics/plugin.py b/ckanext/googleanalytics/plugin.py index 1929ff0..708d58c 100644 --- a/ckanext/googleanalytics/plugin.py +++ b/ckanext/googleanalytics/plugin.py @@ -4,7 +4,7 @@ import os from paste.deploy.converters import asbool from genshi.filters import Transformer from genshi import HTML -from genshi.core import START, TEXT, END +from genshi.core import START, TEXT from genshi.filters.transform import INSIDE, EXIT from pylons import config, request from ckan.plugins import implements, SingletonPlugin @@ -58,7 +58,7 @@ class GoogleAnalyticsPlugin(SingletonPlugin): # add some stats def download_adder(stream): - download_html = ''' + download_html = ''' (downloaded %s times)''' count = None for mark, (kind, data, pos) in stream: @@ -81,11 +81,11 @@ class GoogleAnalyticsPlugin(SingletonPlugin): ''' # perform the stream transform - stream = stream | Transformer('//div[@class="resource-url"]//a')\ + stream = stream | Transformer('//p[@class="resource-url"]//a')\ .attr('onclick', js_attr) if show_downloads: - stream = stream | Transformer('//div[@class="resource-url"]//a')\ + stream = stream | Transformer('//p[@class="resource-url"]//a')\ .apply(download_adder) stream = stream | Transformer('//link[@rel="stylesheet"]')\ .append(HTML(download_style))