Back to index

moin  1.9.0~rc2
Functions | Variables
MoinMoin.macro.InterWiki Namespace Reference

Functions

def macro_InterWiki

Variables

list Dependencies = ["pages"]

Function Documentation

Definition at line 13 of file InterWiki.py.

00013 
00014 def macro_InterWiki(macro):
00015     interwiki_list = wikiutil.load_wikimap(macro.request)
00016     iwlist = interwiki_list.items() # this is where we cached it
00017     iwlist.sort()
00018     fmt = macro.formatter
00019     output = []
00020     output.append(fmt.definition_list(1))
00021     for tag, url in iwlist:
00022         output.append(fmt.definition_term(1))
00023         output.append(fmt.code(1))
00024         output.append(fmt.url(1, wikiutil.join_wiki(url, 'RecentChanges')))
00025         output.append(fmt.text(tag))
00026         output.append(fmt.url(0))
00027         output.append(fmt.code(0))
00028         output.append(fmt.definition_term(0))
00029         output.append(fmt.definition_desc(1))
00030         output.append(fmt.code(1))
00031         if '$PAGE' not in url:
00032             output.append(fmt.url(1, url))
00033             output.append(fmt.text(url))
00034             output.append(fmt.url(0))
00035         else:
00036             output.append(fmt.text(url))
00037         output.append(fmt.code(0))
00038         output.append(fmt.definition_desc(1))
00039     output.append(fmt.definition_list(0))
00040     return u''.join(output)
00041 

Variable Documentation

Definition at line 9 of file InterWiki.py.