|
a/Allura/allura/controllers/feed.py |
|
b/Allura/allura/controllers/feed.py |
|
... |
|
... |
23 |
|
23 |
|
24 |
from allura import model as M
|
24 |
from allura import model as M
|
25 |
from allura.lib import helpers as h
|
25 |
from allura.lib import helpers as h
|
26 |
|
26 |
|
27 |
|
27 |
|
28 |
class Feed(object):
|
28 |
class FeedArgs(object):
|
29 |
"""A facade for the arguments required by
|
29 |
"""A facade for the arguments required by
|
30 |
:meth:`allura.model.artifact.Feed.feed`.
|
30 |
:meth:`allura.model.artifact.Feed.feed`.
|
31 |
|
31 |
|
32 |
Used by :meth:`FeedController.feed` to create a real feed.
|
32 |
Used by :meth:`FeedController.feed` to create a real feed.
|
33 |
|
33 |
|
|
... |
|
... |
90 |
response.headers['Content-Type'] = ''
|
90 |
response.headers['Content-Type'] = ''
|
91 |
response.content_type = 'application/xml'
|
91 |
response.content_type = 'application/xml'
|
92 |
return feed.writeString('utf-8')
|
92 |
return feed.writeString('utf-8')
|
93 |
|
93 |
|
94 |
def get_feed(self, project, app, user):
|
94 |
def get_feed(self, project, app, user):
|
95 |
"""Return a default :class:`Feed` for this controller.
|
95 |
"""Return a default :class:`FeedArgs` for this controller.
|
96 |
|
96 |
|
97 |
Subclasses should override to customize the feed.
|
97 |
Subclasses should override to customize the feed.
|
98 |
|
98 |
|
99 |
:param project: :class:`allura.model.project.Project`
|
99 |
:param project: :class:`allura.model.project.Project`
|
100 |
:param app: :class:`allura.app.Application`
|
100 |
:param app: :class:`allura.app.Application`
|
101 |
:param user: :class:`allura.model.auth.User`
|
101 |
:param user: :class:`allura.model.auth.User`
|
102 |
:rtype: :class:`Feed`
|
102 |
:rtype: :class:`FeedArgs`
|
103 |
|
103 |
|
104 |
"""
|
104 |
"""
|
105 |
return Feed(
|
105 |
return FeedArgs(
|
106 |
dict(project_id=project._id, app_config_id=app.config._id),
|
106 |
dict(project_id=project._id, app_config_id=app.config._id),
|
107 |
'Recent changes to %s' % app.config.options.mount_point,
|
107 |
'Recent changes to %s' % app.config.options.mount_point,
|
108 |
app.url)
|
108 |
app.url)
|