annotate MoinMoin/action/rss_rc.py @ 5522:879674c9320a

AttachFile: add ticketing for all operations that do modifications Tickets for upload (POST), also for every (GET) URL except do=get and do=view. Avoid KeyError if there is no ticket (was a minor issues, because there has to be one). Use the same i18n string for all "Please use the interactive user interface" messages.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 08 Feb 2010 18:56:07 +0100
parents a739558ca3dc
children 85884c67228d
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:
1799
06ce4843b9b5 remove some XXX strings
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1791
diff changeset
27 httpheaders = ["Content-Type: text/plain; charset=%s" % config.charset]
06ce4843b9b5 remove some XXX strings
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1791
diff changeset
28 request.emit_http_headers(httpheaders)
06ce4843b9b5 remove some XXX strings
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1791
diff changeset
29 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
30 return
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
31
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
32 cfg = request.cfg
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
33
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
34 # get params
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
35 items_limit = 100
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
36 try:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
37 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
38 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
39 except (KeyError, ValueError):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
40 # 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
41 max_items = 15
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
42 try:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
43 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
44 except ValueError:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
45 unique = 0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
46 try:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
47 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
48 except ValueError:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
49 diffs = 0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
50 ## 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
51 try:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
52 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
53 except ValueError:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
54 ddiffs = 0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
55
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
56 # get data
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
57 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
58 logdata = []
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
59 counter = 0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
60 pages = {}
15
5a2a8201bb6f make moin friendlier to proxies, thanks to ASF
Thomas Waldmann <tw@waldmann-edv.de>
parents: 0
diff changeset
61 lastmod = 0
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
62 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
63 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
64 continue
1184
b1deb9496f41 use startswith/endswith
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1113
diff changeset
65 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
66 ((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
67 #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
68 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
69 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
70 logdata.append(line)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
71 pages[line.pagename] = None
15
5a2a8201bb6f make moin friendlier to proxies, thanks to ASF
Thomas Waldmann <tw@waldmann-edv.de>
parents: 0
diff changeset
72
5a2a8201bb6f make moin friendlier to proxies, thanks to ASF
Thomas Waldmann <tw@waldmann-edv.de>
parents: 0
diff changeset
73 if not lastmod:
5a2a8201bb6f make moin friendlier to proxies, thanks to ASF
Thomas Waldmann <tw@waldmann-edv.de>
parents: 0
diff changeset
74 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
75
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
76 counter += 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
77 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
78 break
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
79 del log
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
80
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
81 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
82 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
83
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
84 # 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
85 # 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
86 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
87 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
88 if 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
89 request.emit_http_headers(["Status: 304 Not modified"])
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
90 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
91 request.emit_http_headers(["Status: 304 Not modified"])
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 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
93 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
94 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
95 request.emit_http_headers(["Status: 304 Not modified"])
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
96 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
97 request.emit_http_headers(["Status: 304 Not modified"])
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 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
99 # 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
100 # defined for suggested cache lifetime of the RecentChanges RSS doc
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
101 expires = timefuncs.formathttpdate(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
102
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
103 httpheaders = ["Content-Type: text/xml; charset=%s" % config.charset,
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
104 "Expires: %s" % expires,
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
105 "Last-Modified: %s" % 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
106 "Etag: %s" % etag, ]
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
107
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
108 # send the generated XML document
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
109 request.emit_http_headers(httpheaders)
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
110
1665
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
111 baseurl = request.getBaseURL()
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
112 if not baseurl.endswith('/'):
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
113 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
114
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 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
116 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
117 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
118
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 # 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
120 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
121 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
122
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 # 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
124 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
125 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
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 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
128 ' 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
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 "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
131 ' 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
132 ' \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 ' 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
134 ' \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
135 ' 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
136 ' 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
137 '-->\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
138 )
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
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
140 # 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
141 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
142 (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
143 })
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
144 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
145 page = Page(request, pagename)
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
146 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
147 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
148 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
149 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
150 (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
151 })
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 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
153 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
154
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
155 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
156 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
157 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
158 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
159 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
160 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
161 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
162 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
163 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
164 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
165
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
166 # 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
167 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
168 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
169 (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
170 })
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.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
172 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
173 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
174 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
175
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
176 # 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
177 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
178 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
179 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
180 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
181 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
182
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
183 # 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
184 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
185 if ddiffs:
1665
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
186 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
187 else:
1665
c57f72b49ea2 cleanup rss_rc action, use page.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1184
diff changeset
188 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
189
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
190 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
191
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
192 # 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
193 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
194 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
195 # 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
196 # 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
197 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
198
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 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
200 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
201 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
202 if rev <= item.rev:
2450
3d08f1cb4429 pep8 whitespace fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2286
diff changeset
203 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
204 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
205 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
206 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
207 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
208 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
209 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
210 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
211 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
212 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
213
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 # 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
215 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
216 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
217 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
218 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
219 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
220 ##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
221 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
222 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
223 ##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
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 # 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
226 # 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
227
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.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
229 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
230 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
231 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
232 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
233
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
234 # 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
235 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
236 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
237 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
238 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
239 # handler.simpleNode(('wiki', 'importance'), ) # ( major | minor )
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
240 # 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
241
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.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
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 # 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
245 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
246
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
247 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
248