/usr/share/pyshared/MoinMoin/macro/InterWiki.py is in python-moinmoin 1.9.3-1ubuntu2.3.
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 | # -*- coding: iso-8859-1 -*-
"""
Outputs the interwiki map.
@copyright: 2007 MoinMoin:ThomasWaldmann
@license: GNU GPL, see COPYING for details
"""
Dependencies = ["pages"] # if interwikimap is editable
from MoinMoin import wikiutil
def macro_InterWiki(macro):
interwiki_list = wikiutil.load_wikimap(macro.request)
iwlist = interwiki_list.items() # this is where we cached it
iwlist.sort()
fmt = macro.formatter
output = []
output.append(fmt.definition_list(1))
for tag, url in iwlist:
output.append(fmt.definition_term(1))
output.append(fmt.code(1))
output.append(fmt.url(1, wikiutil.join_wiki(url, 'RecentChanges')))
output.append(fmt.text(tag))
output.append(fmt.url(0))
output.append(fmt.code(0))
output.append(fmt.definition_term(0))
output.append(fmt.definition_desc(1))
output.append(fmt.code(1))
if '$PAGE' not in url:
output.append(fmt.url(1, url))
output.append(fmt.text(url))
output.append(fmt.url(0))
else:
output.append(fmt.text(url))
output.append(fmt.code(0))
output.append(fmt.definition_desc(1))
output.append(fmt.definition_list(0))
return u''.join(output)
|