示例#1
0
文件: server.py 项目: drcraig/skim
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'})
示例#2
0
文件: server.py 项目: drcraig/skim
def all_subscriptions():
    return render_template('subscriptions.html', subscriptions=subscriptions.subscriptions())