Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigiboard / vigiboard / controllers / feeds.py @ 011743be

History | View | Annotate | Download (971 Bytes)

1
# -*- coding: utf-8 -*-
2
# Copyright (C) 2006-2020 CS GROUP - France
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

    
11
from vigilo.turbogears.controllers import BaseController
12

    
13
LOGGER = logging.getLogger(__name__)
14

    
15
__all__ = ['FeedsController']
16

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

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