Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigiboard / vigiboard / controllers / feeds.py @ b373a5de

History | View | Annotate | Download (1.14 KB)

1
# -*- coding: utf-8 -*-
2
# Copyright (C) 2006-2011 CS-SI
3
# License: GNU GPL v2 <http://www.gnu.org/licenses/gpl-2.0.html>
4

    
5
"""Sample controller module"""
6

    
7
import logging
8
from tg import expose, redirect, config, request, response
9
from pylons.i18n import ugettext as _
10
from datetime import datetime
11
from repoze.what.predicates import Any, has_permission, in_group
12
from tg.controllers import CUSTOM_CONTENT_TYPE
13

    
14
from vigilo.turbogears.controllers import BaseController
15

    
16
LOGGER = logging.getLogger(__name__)
17

    
18
__all__ = ['FeedsController']
19

    
20
class FeedsController(BaseController):
21
    # pylint: disable-msg=R0201,W0613
22

    
23
    @expose('atom.xml', content_type=CUSTOM_CONTENT_TYPE)
24
    def atom(self, token, username):
25
        """
26
        """
27
        response.headers['Content-Type'] = 'application/atom+xml; charset=utf-8'
28
        return {
29
            'feed': {
30
                'title': 'VigiBoard',
31
                'mtime': datetime.now(),
32
            },
33
            'entries': [
34
                {
35
                    'title': 'Test',
36
                    'mtime': datetime.now(),
37
                    'summary': 'Foo bar on baz',
38
                }
39
            ],
40
        }