Back to index

moin  1.9.0~rc2
AttachList.py
Go to the documentation of this file.
00001 """
00002     MoinMoin - AttachList Macro
00003 
00004     A macro to produce a list of attached files
00005 
00006     Usage: <<AttachList([pagename,mime_type])>>
00007 
00008     If pagename isn't set, the current pagename is used.
00009     If mime_type isn't given, all files are listed.
00010 
00011     @copyright: 2004 Jacob Cohen, Nigel Metheringham,
00012                 2006 MoinMoin:ReimarBauer
00013     @license: GNU GPL, see COPYING for details.
00014 """
00015 
00016 from MoinMoin.action.AttachFile import _build_filelist
00017 
00018 def macro_AttachList(macro, pagename=None, mime_type=u'*'):
00019     # defaults if we don't get anything better
00020     if not pagename:
00021         pagename = macro.formatter.page.page_name
00022 
00023     return _build_filelist(macro.request, pagename, 0, 1, mime_type=mime_type)
00024