view MoinMoin/macro/AttachList.py @ 4468:fad2936d33a7 1.8.1

added dummy mig script for 1.8.1, bumped version number
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 24 Dec 2008 16:32:46 +0100
parents 03b3c6fd70e3
children 378bfb1d0eec
line wrap: on
line source
"""
    MoinMoin - AttachList Macro

    A macro to produce a list of attached files

    Usage: <<AttachList([pagename,mime_type])>>

    If pagename isn't set, the current pagename is used.
    If mime_type isn't given, all files are listed.

    @copyright: 2004 Jacob Cohen, Nigel Metheringham,
                2006 MoinMoin:ReimarBauer
    @license: GNU GPL, see COPYING for details.
"""

from MoinMoin.action.AttachFile import _build_filelist

def macro_AttachList(macro, pagename=None, mime_type=u'*'):
    # defaults if we don't get anything better
    if not pagename:
        pagename = macro.formatter.page.page_name

    return _build_filelist(macro.request, pagename, 0, 1, mime_type=mime_type)