Back to index

moin  1.9.0~rc2
Functions
MoinMoin.action.titleindex Namespace Reference

Functions

def execute

Function Documentation

def MoinMoin.action.titleindex.execute (   pagename,
  request 
)

Definition at line 16 of file titleindex.py.

00016 
00017 def execute(pagename, request):
00018     # get the MIME type
00019     mimetype = request.values.get('mimetype', "text/plain")
00020     request.mimetype = mimetype
00021 
00022     # Get list of user readable pages
00023     pages = request.rootpage.getPageList()
00024     pages.sort()
00025 
00026     if mimetype == "text/xml":
00027         request.write('<?xml version="1.0" encoding="%s"?>\r\n' % (config.charset, ))
00028         request.write('<TitleIndex>\r\n')
00029         for name in pages:
00030             request.write('  <Title>%s</Title>\r\n' % (util.TranslateCDATA(name), ))
00031         request.write('</TitleIndex>\r\n')
00032     else:
00033         for name in pages:
00034             request.write(name+'\r\n')
00035