annotate MoinMoin/parser/text_diff.py @ 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
rev   line source
2277
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
1 # -*- coding: iso-8859-1 -*-
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
2 """
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
3 MoinMoin - Diff Parser - highlights diff tool output
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
4
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
5 @copyright: 2006 Emilio Lopes, inspired by previous work
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
6 done by Fabien Ninoles and Juergen Hermann
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
7 @license: GNU GPL, see COPYING for details.
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
8 """
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
9
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
10 from MoinMoin.parser._ParserBase import ParserBase
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
11
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
12 class Parser(ParserBase):
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
13 parsername = "ColorizedDiff"
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
14 extensions = ['.diff', '.patch', ]
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
15 Dependencies = []
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
16
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
17 def setupRules(self):
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
18 ParserBase.setupRules(self)
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
19
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
20 self.addRule("Comment", r'^(diff .*?)$')
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
21 self.addRule("Comment", r'^(\*\*\* .*?)$')
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
22 self.addRule("Comment", r'^(--- .*?)$')
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
23 self.addRule("Comment", r'^(\+\+\+ .*?)$')
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
24 self.addRule("Comment", r'^\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* *$')
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
25
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
26 self.addRule("DiffSeparator", r'^(@@ .*?)$')
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
27 self.addRule("DiffSeparator", r'^--- *$')
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
28
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
29 self.addRule("DiffAdded", r'^(\+.*?)$')
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
30 self.addRule("DiffRemoved", r'^(-.*?)$')
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
31 self.addRule("DiffAdded", r'^(>.*?)$')
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
32 self.addRule("DiffRemoved", r'^(<.*?)$')
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
33 self.addRule("DiffChanged", r'^(!.*?)$')
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
34
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
35 self.addRuleFormat("DiffAdded")
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
36 self.addRuleFormat("DiffRemoved")
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
37 self.addRuleFormat("DiffChanged")
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
38 self.addRuleFormat("DiffSeparator")
5638ffa2fb38 replace crlf in python src files by lf
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
39