17
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
23
from loggerhead import util
22
from loggerhead.templatefunctions import templatefunctions
24
from turbosimpletal import TurboZpt
27
tt = t.load_template('loggerhead.templates.atom')
30
26
class AtomUI (object):
32
28
def __init__(self, branch):
33
29
# BranchView object
34
30
self._branch = branch
35
31
self.log = branch.log
37
def default(self, response, request):
38
h = self._branch.history
42
pagesize = int(20)#self._branch.config.get('pagesize', '20'))
44
revid_list = h.get_file_view(h.last_revid, None)
45
entries = list(h.get_changes(list(revid_list)[:pagesize]))
48
'branch': self._branch,
52
'updated': entries[0].date.isoformat() + 'Z',
54
vals.update(templatefunctions)
55
response.headers['Content-Type'] = 'application/atom+xml'
56
tt.expand_(response, **vals)
33
@turbogears.expose(template='loggerhead.templates.atom', format="xml", content_type="application/atom+xml")
34
def default(self, *args):
35
h = self._branch.get_history()
36
pagesize = int(self._branch.config.get('pagesize', '20'))
38
revid_list, start_revid = h.get_file_view(None, None)
39
entries = list(h.get_changes(list(revid_list)[:pagesize]))
42
'external_url': cherrypy.request.base,
43
'branch': self._branch,
47
'scan_url': '/changes',
48
'updated': entries[0].date.isoformat() + 'Z',