Skip to content

Commit

Permalink
[#1251] Deprecate with maintain.deprecated() instead of comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorbaptista committed Apr 17, 2014
1 parent ab8a053 commit beaf2af
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ckan/controllers/package.py
Expand Up @@ -386,11 +386,9 @@ def read(self, id, format='html'):

# can the resources be previewed?
for resource in c.pkg_dict['resources']:

######## section backwards compatibility with preview iterface
# Backwards compatibility with preview interface
resource['can_be_previewed'] = self._resource_preview(
{'resource': resource, 'package': c.pkg_dict})
#############################################################

resource_views = get_action('resource_view_list')(
context, {'id': resource['id']})
Expand Down Expand Up @@ -1119,8 +1117,9 @@ def resource_delete(self, id, resource_id):
abort(404, _('Resource not found'))
return render('package/confirm_delete_resource.html')

@maintain.deprecated('`autocomplete` is deprecated. Please use '
'/api/2/util/dataset/autocomplete')
def autocomplete(self):
# DEPRECATED in favour of /api/2/util/dataset/autocomplete
q = unicode(request.params.get('q', ''))
if not len(q):
return ''
Expand Down Expand Up @@ -1228,8 +1227,10 @@ def resource_read(self, id, resource_id):

return render('package/resource_read.html', extra_vars=vars)

@maintain.deprecated('Resource preview is deprecated. Please use the new '
'resource views')
def _resource_preview(self, data_dict):
'''Deprecated resource preview function'''
'''Deprecated in 2.3'''
return bool(datapreview.get_preview_plugin(data_dict, return_first=True))

def resource_download(self, id, resource_id, filename=None):
Expand Down

0 comments on commit beaf2af

Please sign in to comment.