Skip to content

Commit

Permalink
reformat /ckan/ckan/controllers/feed.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jbspeakr authored and tobes committed Apr 11, 2013
1 parent 87e0df4 commit a591c7d
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions ckan/controllers/feed.py
Expand Up @@ -152,7 +152,6 @@ def _create_atom_id(resource_path, authority_name=None, date_string=None):


class FeedController(BaseController):

base_url = config.get('ckan.site_url')

def _alternate_url(self, params, **kwargs):
Expand Down Expand Up @@ -207,7 +206,6 @@ def group(self, id):
navigation_urls=navigation_urls)

def tag(self, id):

data_dict, params = self._parse_url_params()
data_dict['fq'] = 'tags:"%s"' % id

Expand Down Expand Up @@ -323,7 +321,6 @@ def custom(self):

def output_feed(self, results, feed_title, feed_description,
feed_link, feed_url, navigation_urls, feed_guid):

author_name = config.get('ckan.feeds.author_name', '').strip() or \
config.get('ckan.site_id', '').strip()
author_link = config.get('ckan.feeds.author_link', '').strip() or \
Expand All @@ -349,8 +346,8 @@ def output_feed(self, results, feed_title, feed_description,
feed.add_item(
title=pkg.get('title', ''),
link=self.base_url + h.url_for(controller='package',
action='read',
id=pkg['id']),
action='read',
id=pkg['id']),
description=pkg.get('notes', ''),
updated=h.date_str_to_datetime(pkg.get('metadata_modified')),
published=h.date_str_to_datetime(pkg.get('metadata_created')),
Expand All @@ -360,10 +357,10 @@ def output_feed(self, results, feed_title, feed_description,
categories=[t['name'] for t in pkg.get('tags', [])],
enclosure=webhelpers.feedgenerator.Enclosure(
self.base_url + h.url_for(controller='api',
register='package',
action='show',
id=pkg['name'],
ver='2'),
register='package',
action='show',
id=pkg['name'],
ver='2'),
unicode(len(json.dumps(pkg))), # TODO fix this
u'application/json')
)
Expand Down Expand Up @@ -433,7 +430,6 @@ def _parse_url_params(self):
Returns the constructed search-query dict, and the valid URL
query parameters.
"""

try:
page = int(request.params.get('page', 1)) or 1
except ValueError:
Expand Down

0 comments on commit a591c7d

Please sign in to comment.