From b7a2cee4e0a9cc4c55e9b891bf1d77f89c28bb72 Mon Sep 17 00:00:00 2001 From: David Read Date: Mon, 19 Sep 2016 12:32:55 +0100 Subject: [PATCH] Remove unused imports. PEP8. --- ckanext/spatial/controllers/view.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ckanext/spatial/controllers/view.py b/ckanext/spatial/controllers/view.py index 129f5a8..eb3eeef 100644 --- a/ckanext/spatial/controllers/view.py +++ b/ckanext/spatial/controllers/view.py @@ -1,24 +1,23 @@ import urllib2 -from pylons.i18n import _ - -import ckan.lib.helpers as h, json -from ckan.lib.base import BaseController, c, g, request, \ - response, session, render, config, abort +from ckan.lib.base import BaseController, c, request, \ + response, render, abort from ckan.model import Package + class ViewController(BaseController): - def wms_preview(self,id): - #check if package exists + def wms_preview(self, id): + # check if package exists c.pkg = Package.get(id) if c.pkg is None: abort(404, 'Dataset not found') for res in c.pkg.resources: if res.format.lower() == 'wms': - c.wms_url = res.url if not '?' in res.url else res.url.split('?')[0] + c.wms_url = res.url \ + if '?' not in res.url else res.url.split('?')[0] break if not c.wms_url: abort(400, 'This dataset does not have a WMS resource') @@ -26,7 +25,7 @@ class ViewController(BaseController): return render('ckanext/spatial/wms_preview.html') def proxy(self): - if not 'url' in request.params: + if 'url' not in request.params: abort(400) try: server_response = urllib2.urlopen(request.params['url'])