# HG changeset patch # User ReimarBauer # Date 1167886419 -3600 # Node ID 0c5bee903be93b811a18b82b85107eae38de60cb # Parent 3c6f59cafbbe442f90171a8b0680be67eb320a67 add of process_instruction diff -r 3c6f59cafbbe -r 0c5bee903be9 MoinMoin/wikiutil.py --- a/MoinMoin/wikiutil.py Thu Dec 21 03:39:57 2006 +0100 +++ b/MoinMoin/wikiutil.py Thu Jan 04 05:53:39 2007 +0100 @@ -1643,3 +1643,17 @@ def checkTicket(request, ticket): ourticket = createTicket(request, timestamp_str) return ticket == ourticket +def get_process_instruction(text): + """Creates dict of process instructions""" + lines = text.split('\n') + dict = {} + dict["processing_instructions"] = False + for line in lines: + for pi in ("#format", "#refresh", "#redirect", "#deprecated", + "#pragma", "#form", "#acl", "#language"): + if line.lower().startswith(pi): + value = (line.split(pi))[1] + dict[str(pi[1:].lower())] = value.strip() + dict["processing_instructions"] = True + break + return dict