/usr/share/pyshared/MoinMoin/action/links.py is in python-moinmoin 1.9.3-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - "links" action
Generate a link database like MeatBall:LinkDatabase.
@copyright: 2001 Juergen Hermann <jh@web.de>
@license: GNU GPL, see COPYING for details.
"""
from MoinMoin import config, wikiutil
def execute(pagename, request):
_ = request.getText
# get the MIME type
mimetype = request.values.get('mimetype', 'text/html')
request.mimetype = mimetype
if mimetype == "text/html":
request.theme.send_title(_('Full Link List for "%s"') % request.cfg.sitename)
request.write('<pre>')
# Get page dict readable by current user
pages = request.rootpage.getPageDict()
pagelist = pages.keys()
pagelist.sort()
for name in pagelist:
if mimetype == "text/html":
request.write(pages[name].link_to(request))
else:
_emit(request, name)
for link in pages[name].getPageLinks(request):
request.write(" ")
if mimetype == "text/html":
if link in pages:
request.write(pages[link].link_to(request))
else:
_emit(request, link)
else:
_emit(request, link)
request.write('\n')
if mimetype == "text/html":
request.write('</pre>')
request.theme.send_footer(pagename)
request.theme.send_closing_html()
def _emit(request, pagename):
""" Send pagename, encode it if it contains spaces
"""
request.write(wikiutil.quoteWikinameURL(pagename))
|