# GetValues.py ''' This macro shows a list of pages a) whose names match the given regular expression and b) who contain a definition with a certain heading which optionally has a value matching a certain re Usage: [[GetValues(PageRE,DefinitionTermRE[,DefinitionValueRE])]] Examples: [[GetValues(.*Service,Host)]] might output the following: . FooService Host: FooHost . BarService Host: BarHost TODO: History: 1.0 First version - MarkusMaier 1.1 Key is regular expression - MarkusMaier 1.2 Added optional re as restriction on values - MarkusMaier 1.3 Multiple matches for one page are collapsed to one list - MarkusMaier 1.4 Output is now a definition list - MarkusMaier ''' Dependencies = [1] import re from MoinMoin.wikidicts import Dict def execute(macro,args): args = args.split(",") page_re = args[0] key_re = args[1] if (len(args) < 3): def_re = ".*" else: def_re = args[2] result = "