[Moin-devel] CVS: MoinMoin request.py,1.11,1.12 wikiaction.py,1.74,1.75
J?rgen Hermann
jhermann at users.sourceforge.net
Tue Jun 4 13:48:06 EDT 2002
Update of /cvsroot/moin/MoinMoin
In directory usw-pr-cvs1:/tmp/cvs-serv17233
Modified Files:
request.py wikiaction.py
Log Message:
Dumping version history using browser widget
Index: request.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/request.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** request.py 23 May 2002 20:38:03 -0000 1.11
--- request.py 4 Jun 2002 20:47:51 -0000 1.12
***************
*** 8,12 ****
"""
! import os, string, time
#############################################################################
--- 8,12 ----
"""
! import os, string, time, sys
#############################################################################
***************
*** 95,97 ****
--- 95,102 ----
return self.logger
+
+ def write(self, data):
+ """ Write to output stream.
+ """
+ sys.stdout.write(data)
Index: wikiaction.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/wikiaction.py,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -r1.74 -r1.75
*** wikiaction.py 16 May 2002 18:28:15 -0000 1.74
--- wikiaction.py 4 Jun 2002 20:47:51 -0000 1.75
***************
*** 318,333 ****
# open log for this page
from MoinMoin import editlog
log = editlog.EditLog()
log.filter(pagename=pagename)
! print '<h2>' + _('Revision History') + '</h2>\n'
! print '<table border="1" cellpadding="3" cellspacing="0">\n'
! print '<tr><th>#</th>'
! print '<th>' + _('Date') + '</th>'
! print '<th>' + _('Size') + '</th>'
! if config.show_hosts:
! print '<th>' + _('Editor') + '</th>'
! print '<th>' + _('Comment') + '</th>'
! print '<th>' + _('Action') + '</th></tr>\n'
count = 1
for file in revisions:
--- 318,336 ----
# open log for this page
from MoinMoin import editlog
+ from MoinMoin.util.dataset import TupleDataset, Column
+
log = editlog.EditLog()
log.filter(pagename=pagename)
! history = TupleDataset()
! history.columns = [
! Column('count', label='#', align='right'),
! Column('mtime', label=_('Date'), align='right'),
! Column('size', label=_('Size'), align='right'),
! Column('editor', label=_('Editor'), hidden=not config.show_hosts),
! Column('comment', label=_('Comment')),
! Column('action', label=_('Action')),
! ]
!
count = 1
for file in revisions:
***************
*** 353,370 ****
text=_('diff'),
querystr='action=diff&date=%d' % mtime))
- print '<tr><td align="right">%d</td><td align="right"> %s</td><td align="right"> %d</td>' % (
- count,
- request.user.getFormattedDateTime(st[ST_MTIME]),
- st[ST_SIZE])
-
- if config.show_hosts:
- print '<td>%s</td>' % (log.getEditor() or _("N/A"),)
! print '<td>%s</td>' % (cgi.escape(log.comment) or ' ')
!
! print '<td> %s</td></tr>\n' % (actions,)
count = count + 1
if count > 100: break
! print '</table>\n'
wikiutil.send_footer(request, pagename, showpage=1)
--- 356,380 ----
text=_('diff'),
querystr='action=diff&date=%d' % mtime))
! history.addRow((
! count,
! ' ' + request.user.getFormattedDateTime(st[ST_MTIME]),
! ' ' + str(st[ST_SIZE]),
! log.getEditor() or _("N/A"),
! cgi.escape(log.comment) or ' ',
! actions,
! ))
count = count + 1
if count > 100: break
!
! # print version history
! from MoinMoin.widget.browser import DataBrowserWidget
! from MoinMoin.formatter.text_html import Formatter
!
! print '<h2>' + _('Revision History') + '</h2>\n'
! request.formatter = Formatter(request)
! history_table = DataBrowserWidget(request)
! history_table.setData(history)
! history_table.render()
wikiutil.send_footer(request, pagename, showpage=1)
More information about the Moin-devel
mailing list