Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigiboard / vigiboard / controllers / feeds.py @ 25892058

History | View | Annotate | Download (1.01 KB)

1
# -*- coding: utf-8 -*-
2
# Copyright (C) 2006-2013 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, response
9
from datetime import datetime
10
from tg.controllers import CUSTOM_CONTENT_TYPE
11

    
12
from vigilo.turbogears.controllers import BaseController
13

    
14
LOGGER = logging.getLogger(__name__)
15

    
16
__all__ = ['FeedsController']
17

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

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