annotate MoinMoin/action/rss_rc.py @ 4176:85884c67228d

Replaced/removed calls to request.emit_http_headers
author Florian Krupicka <florian.krupicka@googlemail.com>
date Wed, 18 Jun 2008 00:28:07 +0200
parents a739558ca3dc
children fc20a076aad0
rev   line source
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
2 RSS Handling
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
3
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
4 If you do changes, please check if it still validates after your changes:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
5
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
6 http://feedvalidator.org/
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
7
1918
bb2e053067fb fixing copyright headers: remove umlauts (encoding troubles), make epydoc compatible, reformat
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1816
diff changeset
8 @copyright: 2006-2007 MoinMoin:ThomasWaldmann
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
9 @license: GNU GPL, see COPYING for details.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
10 """
1791
6dd2e29acffe Eclipse PyDev Check: fixed lots of its errors and warnings
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1665
diff changeset
11 import StringIO, re, time
476
4be11eec9c4f MoinMoin.util.datetime -> timefuncs to avoid conflict/confusion with stdlib datetime, also moved util.W3CDate there
Thomas Waldmann <tw@waldmann-edv.de>
parents: 108
diff changeset
12 from MoinMoin import wikixml, config, wikiutil
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
13 from MoinMoin.logfile import editlog
476
4be11eec9c4f MoinMoin.util.datetime -> timefuncs to avoid conflict/confusion with stdlib datetime, also moved util.W3CDate there
Thomas Waldmann <tw@waldmann-edv.de>
parents: 108
diff changeset
14 from MoinMoin.util import timefuncs
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
15 from MoinMoin.Page import Page
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
16 from MoinMoin.wikixml.util import RssGenerator
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
17
1665
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
18 def full_url(request, page, querystr=None, anchor=None):
3234
a739558ca3dc Page.url() default changed to relative=False
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2450
diff changeset
19 url = page.url(request, anchor=anchor, querystr=querystr)
1816
4a31739bc6e1 Page.url(): removed escaping support
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1799
diff changeset
20 url = wikiutil.escape(url)
4a31739bc6e1 Page.url(): removed escaping support
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1799
diff changeset
21 return request.getQualifiedURL(url)
1665
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
22
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
23 def execute(pagename, request):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
24 """ Send recent changes as an RSS document
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
25 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
26 if not wikixml.ok:
4176
85884c67228d Replaced/removed calls to request.emit_http_headers
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3234
diff changeset
27 request.response.mimetype = 'text/plain'
1799
06ce4843b9b5 remove some XXX strings
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1791
diff changeset
28 request.write("rss_rc action is not supported because of missing pyxml module.")
06ce4843b9b5 remove some XXX strings
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1791
diff changeset
29 return
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
30
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
31 cfg = request.cfg
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
32
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
33 # get params
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
34 items_limit = 100
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
35 try:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
36 max_items = int(request.form['items'][0])
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
37 max_items = min(max_items, items_limit) # not more than `items_limit`
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
38 except (KeyError, ValueError):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
39 # not more than 15 items in a RSS file by default
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
40 max_items = 15
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
41 try:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
42 unique = int(request.form.get('unique', [0])[0])
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
43 except ValueError:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
44 unique = 0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
45 try:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
46 diffs = int(request.form.get('diffs', [0])[0])
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
47 except ValueError:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
48 diffs = 0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
49 ## ddiffs inserted by Ralf Zosel <ralf@zosel.com>, 04.12.2003
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
50 try:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
51 ddiffs = int(request.form.get('ddiffs', [0])[0])
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
52 except ValueError:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
53 ddiffs = 0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
54
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
55 # get data
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
56 log = editlog.EditLog(request)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
57 logdata = []
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
58 counter = 0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
59 pages = {}
15
5a2a8201bb6f make moin friendlier to proxies, thanks to ASF
Thomas Waldmann <tw@waldmann-edv.de>
parents: 0
diff changeset
60 lastmod = 0
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
61 for line in log.reverse():
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
62 if not request.user.may.read(line.pagename):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
63 continue
1184
b1deb9496f41 use startswith/endswith
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1113
diff changeset
64 if (not line.action.startswith('SAVE') or
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
65 ((line.pagename in pages) and unique)): continue
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
66 #if log.dayChanged() and log.daycount > _MAX_DAYS: break
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
67 line.editor = line.getInterwikiEditorData(request)
476
4be11eec9c4f MoinMoin.util.datetime -> timefuncs to avoid conflict/confusion with stdlib datetime, also moved util.W3CDate there
Thomas Waldmann <tw@waldmann-edv.de>
parents: 108
diff changeset
68 line.time = timefuncs.tmtuple(wikiutil.version2timestamp(line.ed_time_usecs)) # UTC
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
69 logdata.append(line)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
70 pages[line.pagename] = None
15
5a2a8201bb6f make moin friendlier to proxies, thanks to ASF
Thomas Waldmann <tw@waldmann-edv.de>
parents: 0
diff changeset
71
5a2a8201bb6f make moin friendlier to proxies, thanks to ASF
Thomas Waldmann <tw@waldmann-edv.de>
parents: 0
diff changeset
72 if not lastmod:
5a2a8201bb6f make moin friendlier to proxies, thanks to ASF
Thomas Waldmann <tw@waldmann-edv.de>
parents: 0
diff changeset
73 lastmod = wikiutil.version2timestamp(line.ed_time_usecs)
5a2a8201bb6f make moin friendlier to proxies, thanks to ASF
Thomas Waldmann <tw@waldmann-edv.de>
parents: 0
diff changeset
74
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
75 counter += 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
76 if counter >= max_items:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
77 break
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
78 del log
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
79
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
80 timestamp = timefuncs.formathttpdate(lastmod)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
81 etag = "%d-%d-%d-%d-%d" % (lastmod, max_items, diffs, ddiffs, unique)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
82
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
83 # for 304, we look at if-modified-since and if-none-match headers,
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
84 # one of them must match and the other is either not there or must match.
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
85 if request.if_modified_since == timestamp:
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
86 if request.if_none_match:
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
87 if request.if_none_match == etag:
4176
85884c67228d Replaced/removed calls to request.emit_http_headers
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3234
diff changeset
88 request.response.status_code = 304
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
89 else:
4176
85884c67228d Replaced/removed calls to request.emit_http_headers
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3234
diff changeset
90 request.response.status_code = 304
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
91 elif request.if_none_match == etag:
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
92 if request.if_modified_since:
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
93 if request.if_modified_since == timestamp:
4176
85884c67228d Replaced/removed calls to request.emit_http_headers
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3234
diff changeset
94 request.response.status_code = 304
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
95 else:
4176
85884c67228d Replaced/removed calls to request.emit_http_headers
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3234
diff changeset
96 request.response.status_code = 304
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
97 else:
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
98 # generate an Expires header, using whatever setting the admin
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
99 # defined for suggested cache lifetime of the RecentChanges RSS doc
4176
85884c67228d Replaced/removed calls to request.emit_http_headers
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3234
diff changeset
100 expires = time.time() + cfg.rss_cache
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
101
4176
85884c67228d Replaced/removed calls to request.emit_http_headers
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3234
diff changeset
102 request.response.mime_type = 'text/xml'
85884c67228d Replaced/removed calls to request.emit_http_headers
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3234
diff changeset
103 request.response.expires = expires
85884c67228d Replaced/removed calls to request.emit_http_headers
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3234
diff changeset
104 request.response.last_modified = lastmod
85884c67228d Replaced/removed calls to request.emit_http_headers
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3234
diff changeset
105 request.response.headers.add('Etag', etag)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
106
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
107 # send the generated XML document
1665
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
108 baseurl = request.getBaseURL()
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
109 if not baseurl.endswith('/'):
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
110 baseurl += '/'
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
111
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
112 logo = re.search(r'src="([^"]*)"', cfg.logo_string)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
113 if logo:
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
114 logo = request.getQualifiedURL(logo.group(1))
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
115
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
116 # prepare output
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
117 out = StringIO.StringIO()
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
118 handler = RssGenerator(out)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
119
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
120 # start SAX stream
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
121 handler.startDocument()
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
122 handler._out.write(
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
123 '<!--\n'
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
124 ' Add an "items=nnn" URL parameter to get more than the default 15 items.\n'
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
125 ' You cannot get more than %d items though.\n'
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
126 ' \n'
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
127 ' Add "unique=1" to get a list of changes where page names are unique,\n'
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
128 ' i.e. where only the latest change of each page is reflected.\n'
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
129 ' \n'
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
130 ' Add "diffs=1" to add change diffs to the description of each items.\n'
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
131 ' \n'
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
132 ' Add "ddiffs=1" to link directly to the diff (good for FeedReader).\n'
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
133 ' Current settings: items=%i, unique=%i, diffs=%i, ddiffs=%i'
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
134 '-->\n' % (items_limit, max_items, unique, diffs, ddiffs)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
135 )
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
136
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
137 # emit channel description
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
138 handler.startNode('channel', {
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
139 (handler.xmlns['rdf'], 'about'): request.getBaseURL(),
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
140 })
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
141 handler.simpleNode('title', cfg.sitename)
1665
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
142 page = Page(request, pagename)
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
143 handler.simpleNode('link', full_url(request, page))
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
144 handler.simpleNode('description', 'RecentChanges at %s' % cfg.sitename)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
145 if logo:
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
146 handler.simpleNode('image', None, {
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
147 (handler.xmlns['rdf'], 'resource'): logo,
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
148 })
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
149 if cfg.interwikiname:
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
150 handler.simpleNode(('wiki', 'interwiki'), cfg.interwikiname)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
151
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
152 handler.startNode('items')
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
153 handler.startNode(('rdf', 'Seq'))
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
154 for item in logdata:
1665
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
155 anchor = "%04d%02d%02d%02d%02d%02d" % item.time[:6]
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
156 page = Page(request, item.pagename)
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
157 link = full_url(request, page, anchor=anchor)
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
158 handler.simpleNode(('rdf', 'li'), None, attr={(handler.xmlns['rdf'], 'resource'): link, })
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
159 handler.endNode(('rdf', 'Seq'))
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
160 handler.endNode('items')
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
161 handler.endNode('channel')
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
162
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
163 # emit logo data
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
164 if logo:
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
165 handler.startNode('image', attr={
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
166 (handler.xmlns['rdf'], 'about'): logo,
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
167 })
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
168 handler.simpleNode('title', cfg.sitename)
1665
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
169 handler.simpleNode('link', baseurl)
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
170 handler.simpleNode('url', logo)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
171 handler.endNode('image')
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
172
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
173 # emit items
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
174 for item in logdata:
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
175 page = Page(request, item.pagename)
1665
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
176 anchor = "%04d%02d%02d%02d%02d%02d" % item.time[:6]
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
177 rdflink = full_url(request, page, anchor=anchor)
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
178 handler.startNode('item', attr={(handler.xmlns['rdf'], 'about'): rdflink, })
15
5a2a8201bb6f make moin friendlier to proxies, thanks to ASF
Thomas Waldmann <tw@waldmann-edv.de>
parents: 0
diff changeset
179
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
180 # general attributes
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
181 handler.simpleNode('title', item.pagename)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
182 if ddiffs:
1665
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
183 handler.simpleNode('link', full_url(request, page, querystr={'action': 'diff'}))
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
184 else:
1665
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
185 handler.simpleNode('link', full_url(request, page))
15
5a2a8201bb6f make moin friendlier to proxies, thanks to ASF
Thomas Waldmann <tw@waldmann-edv.de>
parents: 0
diff changeset
186
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
187 handler.simpleNode(('dc', 'date'), timefuncs.W3CDate(item.time))
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
188
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
189 # description
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
190 desc_text = item.comment
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
191 if diffs:
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
192 # TODO: rewrite / extend wikiutil.pagediff
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
193 # searching for the matching pages doesn't really belong here
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
194 revisions = page.getRevList()
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
195
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
196 rl = len(revisions)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
197 for idx in range(rl):
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
198 rev = revisions[idx]
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
199 if rev <= item.rev:
2450
3d08f1cb4429 pep8 whitespace fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2286
diff changeset
200 if idx + 1 < rl:
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
201 lines = wikiutil.pagediff(request, item.pagename, revisions[idx+1], item.pagename, 0, ignorews=1)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
202 if len(lines) > 20:
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
203 lines = lines[:20] + ['...\n']
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
204 lines = '\n'.join(lines)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
205 lines = wikiutil.escape(lines)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
206 desc_text = '%s\n<pre>\n%s\n</pre>\n' % (desc_text, lines)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
207 break
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
208 if desc_text:
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
209 handler.simpleNode('description', desc_text)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
210
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
211 # contributor
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
212 edattr = {}
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
213 if cfg.show_hosts:
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
214 edattr[(handler.xmlns['wiki'], 'host')] = item.hostname
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
215 if item.editor[0] == 'interwiki':
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
216 edname = "%s:%s" % item.editor[1]
1665
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
217 ##edattr[(None, 'link')] = baseurl + wikiutil.quoteWikiname(edname)
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
218 else: # 'ip'
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
219 edname = item.editor[1]
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
220 ##edattr[(None, 'link')] = link + "?action=info"
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
221
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
222 # this edattr stuff, esp. None as first tuple element breaks things (tracebacks)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
223 # if you know how to do this right, please send us a patch
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
224
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
225 handler.startNode(('dc', 'contributor'))
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
226 handler.startNode(('rdf', 'Description'), attr=edattr)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
227 handler.simpleNode(('rdf', 'value'), edname)
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
228 handler.endNode(('rdf', 'Description'))
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
229 handler.endNode(('dc', 'contributor'))
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
230
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
231 # wiki extensions
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
232 handler.simpleNode(('wiki', 'version'), "%i" % (item.ed_time_usecs))
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
233 handler.simpleNode(('wiki', 'status'), ('deleted', 'updated')[page.exists()])
1665
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
234 handler.simpleNode(('wiki', 'diff'), full_url(request, page, querystr={'action': 'diff'}))
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
235 handler.simpleNode(('wiki', 'history'), full_url(request, page, querystr={'action': 'info'}))
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
236 # handler.simpleNode(('wiki', 'importance'), ) # ( major | minor )
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
237 # handler.simpleNode(('wiki', 'version'), ) # ( #PCDATA )
1113
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
238
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
239 handler.endNode('item')
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
240
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
241 # end SAX stream
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
242 handler.endDocument()
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
243
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
244 request.write(out.getvalue())
9485500daadf read if-modified-since and if-none-match headers, first use for rss_rc action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1068
diff changeset
245