view MoinMoin/parser/ @ 3125:40c4670c3410

refactored auth package to use own logger
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 27 Feb 2008 10:05:20 +0100
parents 5638ffa2fb38
children e25b00b3a308
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    MoinMoin - Diff Parser - highlights diff tool output

    @copyright: 2006 Emilio Lopes, inspired by previous work
                done by Fabien Ninoles and Juergen Hermann
    @license: GNU GPL, see COPYING for details.

from MoinMoin.parser._ParserBase import ParserBase

class Parser(ParserBase):
    parsername = "ColorizedDiff"
    extensions = ['.diff', '.patch', ]
    Dependencies = []

    def setupRules(self):

        self.addRule("Comment", r'^(diff .*?)$')
        self.addRule("Comment", r'^(\*\*\* .*?)$')
        self.addRule("Comment", r'^(--- .*?)$')
        self.addRule("Comment", r'^(\+\+\+ .*?)$')
        self.addRule("Comment", r'^\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* *$')

        self.addRule("DiffSeparator", r'^(@@ .*?)$')
        self.addRule("DiffSeparator", r'^--- *$')

        self.addRule("DiffAdded", r'^(\+.*?)$')
        self.addRule("DiffRemoved", r'^(-.*?)$')
        self.addRule("DiffAdded", r'^(>.*?)$')
        self.addRule("DiffRemoved", r'^(<.*?)$')
        self.addRule("DiffChanged", r'^(!.*?)$')