@@ -19,24 +19,25 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
from pylons import url, response, tmpl_context as c
from pylons.i18n.translation import _
from rhodecode.lib import safe_unicode
from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
from rhodecode.lib.base import BaseRepoController
from webhelpers.feedgenerator import Atom1Feed, Rss201rev2Feed
log = logging.getLogger(__name__)
class FeedController(BaseRepoController):
@LoginRequired(api_access=True)
@HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
@@ -44,33 +45,33 @@ class FeedController(BaseRepoController)
def __before__(self):
super(FeedController, self).__before__()
#common values for feeds
self.description = _('Changes on %s repository')
self.title = self.title = _('%s %s feed') % (c.rhodecode_name, '%s')
self.language = 'en-us'
self.ttl = "5"
self.feed_nr = 10
def __changes(self, cs):
changes = ''
a = [n.path for n in cs.added]
a = [safe_unicode(n.path) for n in cs.added]
if a:
changes += '\nA ' + '\nA '.join(a)
m = [n.path for n in cs.changed]
m = [safe_unicode(n.path) for n in cs.changed]
if m:
changes += '\nM ' + '\nM '.join(m)
d = [n.path for n in cs.removed]
d = [safe_unicode(n.path) for n in cs.removed]
if d:
changes += '\nD ' + '\nD '.join(d)
changes += '</pre>'
return changes
def atom(self, repo_name):
"""Produce an atom-1.0 feed via feedgenerator module"""
feed = Atom1Feed(title=self.title % repo_name,
link=url('summary_home', repo_name=repo_name,
qualified=True),
Status change: