From 3df0637d6450af2abc57b98fcce1a46fe4e41947 Mon Sep 17 00:00:00 2001 From: Dominik Moritz Date: Fri, 19 Jul 2013 12:30:23 +0200 Subject: [PATCH] [#1119] Text preview was made for XML and Json. Increase their precendence. Also typos. --- ckan/lib/datapreview.py | 6 +++--- ckanext/textpreview/plugin.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ckan/lib/datapreview.py b/ckan/lib/datapreview.py index 1600aad81a3..9dc5f48f08f 100644 --- a/ckan/lib/datapreview.py +++ b/ckan/lib/datapreview.py @@ -21,7 +21,7 @@ def direct(): - ''' Directly embedable formats.''' + ''' Directly embeddable formats.''' direct_embed = config.get('ckan.preview.direct', '').split() return direct_embed or DEFAULT_DIRECT_EMBED @@ -33,14 +33,14 @@ def loadable(): def res_format(resource): - ''' The assummed resource format in lower case. ''' + ''' The assumed resource format in lower case. ''' if not resource['url']: return None return (resource['format'] or resource['url'].split('.')[-1]).lower() def compare_domains(urls): - ''' Return True if the domains of the provided are the same. + ''' Return True if the domains of the provided urls are the same. ''' first_domain = None for url in urls: diff --git a/ckanext/textpreview/plugin.py b/ckanext/textpreview/plugin.py index e43530d61b9..9e6d8172fd1 100644 --- a/ckanext/textpreview/plugin.py +++ b/ckanext/textpreview/plugin.py @@ -22,6 +22,9 @@ 'text/plain': 2, 'txt': 2, 'plain': 2, + 'xml' : 2, + 'json': 2, + 'jsonp': 2 }