def opml_subscriptions(): by_category = defaultdict(list) for subscription in subscriptions.subscriptions(): if subscription.get('categories'): for category in subscription['categories']: by_category[category].append(subscription) else: by_category[''].append(subscription) return (render_template('subscriptions.opml', by_category=by_category, now_rfc822=format_datetime(datetime.utcnow())), 200, {'Content-Type': 'application/xml'})
def all_subscriptions(): return render_template('subscriptions.html', subscriptions=subscriptions.subscriptions())