vigiboard / vigiboard / controllers / feeds.py @ b373a5de
History | View | Annotate | Download (1.14 KB)
1 | bc31210c | Francois POIROTTE | # -*- coding: utf-8 -*-
|
---|---|---|---|
2 | b373a5de | Aurelien BOMPARD | # Copyright (C) 2006-2011 CS-SI
|
3 | # License: GNU GPL v2 <http://www.gnu.org/licenses/gpl-2.0.html>
|
||
4 | |||
5 | bc31210c | Francois POIROTTE | """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 | adb0e63f | Francois POIROTTE | def atom(self, token, username): |
25 | bc31210c | Francois POIROTTE | """
|
26 | """
|
||
27 | 8c4b2f70 | Francois POIROTTE | response.headers['Content-Type'] = 'application/atom+xml; charset=utf-8' |
28 | bc31210c | Francois POIROTTE | 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 | } |