Beispiel #1
0
def execute(macro, args):
    _ = macro.request.getText
    silent = False

    if args is None:
        args = ''
    else:
        args = args.strip().split(',')
        if args[-1].strip() == 'gwikisilent':
            silent = True
            args = args[:-1]

        args = ','.join(args)

    pagelist, metakeys, styles = metatable_parseargs(macro.request,
                                                     args,
                                                     get_all_keys=True)

    if silent:
        return "{0}".format(len(pagelist))

    if not pagelist:
        return _("No matches for") + " '{0}'".format(text_escape(args))

    return "{0} {1} '{2}'".format(len(pagelist), _("matches for"),
                                  text_escape(args))
Beispiel #2
0
def execute(macro, args):
    _ = macro.request.getText
    silent = False

    if args is None:
        args = ''
    else:
        args = args.strip().split(',')
        if args[-1].strip() == 'gwikisilent':
            silent = True
            args = args[:-1]

        args = ','.join(args)

    pagelist, metakeys, styles = metatable_parseargs(macro.request, args,
                                                     get_all_keys=True)

    if silent:
        return "{0}".format(len(pagelist))

    if not pagelist:
        return _("No matches for") + " '{0}'".format(text_escape(args))

    return "{0} {1} '{2}'".format(len(pagelist), _("matches for"),
                                  text_escape(args))
Beispiel #3
0
def execute(macro, args):
    # Parse arguments
    if args is None:
        args = ''

    args = [x.strip() for x in args.split(',')]
    metatableargs = ''
    includeargs = ''

    split = None
    try:
        split = args.index('')
    except ValueError:
        metatableargs = ','.join(args)

    if split:
        metatableargs = ','.join(args[:split])
        includeargs = ','.join(args[split + 1:])

    # Get pages
    pagelist, metakeys, styles = metatable_parseargs(macro.request,
                                                     metatableargs,
                                                     get_all_keys=True)

    if not pagelist:
        return "No match for '{0}'".format(text_escape(metatableargs))

    # Use MoinMoin's include to print the pages
    return moinInclude.execute(macro, make_pagelist(pagelist) + includeargs)