Skip to content

Commit

Permalink
[ckan#1251] Rename text_preview -> text_view
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorbaptista committed Jul 21, 2014
1 parent 38be744 commit f43476c
Show file tree
Hide file tree
Showing 20 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion ckan/config/deployment.ini_tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ ckan.site_id = default
# Add ``pdf_view`` to enable the resource views for PDFs
# Add ``resource_proxy`` to enable resorce proxying and get around the
# same origin policy
ckan.plugins = stats text_preview recline_view
ckan.plugins = stats text_view recline_view


## Front-End Settings
Expand Down
6 changes: 3 additions & 3 deletions ckan/lib/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2126,7 +2126,7 @@ class ViewsCommand(CkanCommand):
an error will be raised:
* "grid"-> "recline_grid_view"
* "pdf" -> "pdf_view"
* "text -> "text_preview"
* "text -> "text_view"
'''

summary = __doc__.split('\n')[0]
Expand Down Expand Up @@ -2188,8 +2188,8 @@ def clean_views(self):
print 'Deleted resource views.'

def create_text_views(self):
if not p.plugin_loaded('text_preview'):
print 'Please enable the text_preview plugin to make the text views.'
if not p.plugin_loaded('text_view'):
print 'Please enable the text_view plugin to make the text views.'
return

if not p.plugin_loaded('resource_proxy'):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
DEFAULT_JSONP_FORMATS = ['jsonp']


class TextPreview(p.SingletonPlugin):
class TextView(p.SingletonPlugin):
'''This extension previews JSON(P).'''

p.implements(p.IConfigurer, inherit=True)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import ckan.tests as tests
import ckan.plugins as plugins
import ckan.lib.helpers as h
import ckanext.textpreview.plugin as previewplugin
import ckanext.textview.plugin as plugin
import ckan.lib.create_test_data as create_test_data
import ckan.config.middleware as middleware

Expand All @@ -27,17 +27,17 @@ def _create_test_view(view_type):
return resource_view, package, resource_id


class TestTextPreview(tests.WsgiAppCase):
class TestTextView(tests.WsgiAppCase):
view_type = 'text'

@classmethod
def setup_class(cls):
cls.config_templates = config['ckan.legacy_templates']
config['ckan.legacy_templates'] = 'false'
wsgiapp = middleware.make_app(config['global_conf'], **config)
plugins.load('text_preview')
plugins.load('text_view')
cls.app = paste.fixture.TestApp(wsgiapp)
cls.p = previewplugin.TextPreview()
cls.p = plugin.TextView()

create_test_data.CreateTestData.create()

Expand All @@ -47,7 +47,7 @@ def setup_class(cls):
@classmethod
def teardown_class(cls):
config['ckan.legacy_templates'] = cls.config_templates
plugins.unload('text_preview')
plugins.unload('text_view')
model.repo.rebuild_db()

def test_can_view(self):
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion doc/extensions/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ you gave to your plugin class in the :ref:`left-hand-side of the assignment in
the setup.py file <setup.py>` (``example_iauthfunctions`` in this example) is
the name you'll use for your plugin in CKAN's config file::

ckan.plugins = stats text_preview recline_view example_iauthfunctions
ckan.plugins = stats text_view recline_view example_iauthfunctions

You should now be able to start CKAN in the development web server and have it
start up without any problems:
Expand Down
4 changes: 2 additions & 2 deletions doc/maintaining/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ settings, for reference.

[app:main]
# This setting will work.
ckan.plugins = stats text_preview recline_view
ckan.plugins = stats text_view recline_view

If the same option is set more than once in your config file, the last
setting given in the file will override the others.
Expand Down Expand Up @@ -512,7 +512,7 @@ Example::

ckan.plugins = disqus datapreview googleanalytics follower

Default value: ``stats text_preview recline_view``
Default value: ``stats text_view recline_view``

Specify which CKAN plugins are to be enabled.

Expand Down
4 changes: 2 additions & 2 deletions doc/maintaining/data-viewer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Or:
Viewing highlighted XML, JSON and plain text data
-------------------------------------------------

**Configuration required:** The ``text_preview`` extension must be added to
**Configuration required:** The ``text_view`` extension must be added to
``ckan.plugins`` in your CKAN configuration file.
This extension is part of CKAN and does not need to be installed
separately.
Expand All @@ -138,7 +138,7 @@ separately.
* ``text/plain``, ``txt``, ``plain``
(can be configured by setting ``ckan.preview.text_formats``)

The ``text_preview`` extension provides previews of many file types that have
The ``text_view`` extension provides previews of many file types that have
been added to a CKAN instance. To view the data the resource format must be
set to one of the resource formats from above (case insensitive).

Expand Down
2 changes: 1 addition & 1 deletion doc/theming/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ an extension and plugin. For a detailed explanation of the steps below, see
5. Add the plugin to the ``ckan.plugins`` setting in your |development.ini|
file::

ckan.plugins = stats text_preview recline_view example_theme
ckan.plugins = stats text_view recline_view example_theme

6. Start CKAN in the development web server:

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@
'datapusher=ckanext.datapusher.plugin:DatapusherPlugin',
'test_tag_vocab_plugin = ckanext.test_tag_vocab_plugin:MockVocabTagsPlugin',
'resource_proxy = ckanext.resourceproxy.plugin:ResourceProxy',
'text_preview = ckanext.textpreview.plugin:TextPreview',
'text_view = ckanext.textview.plugin:TextView',
'pdf_view = ckanext.pdfview.plugin:PdfView',
'recline_view = ckanext.reclineview.plugin:ReclineView',
'recline_grid_view = ckanext.reclineview.plugin:ReclineGridView',
'recline_graph_view = ckanext.reclineview.plugin:ReclineGraphView',
'recline_map_view = ckanext.reclineview.plugin:ReclineMapView',
# FIXME: Remove deprecated resource previews below. You should use the
# versions as *_view instead.
'text_preview = ckanext.textview.plugin:TextView',
'pdf_preview = ckanext.pdfview.plugin:PdfView',
'recline_preview = ckanext.reclineview.plugin:ReclineView',
'recline_grid = ckanext.reclineview.plugin:ReclineGridView',
Expand Down

0 comments on commit f43476c

Please sign in to comment.