Initial import to Tizen
[profile/ivi/python-twisted.git] / doc / lore / howto / listings / lore / factory.py-3
1 from twisted.lore import default
2 from myhtml import spitters
3
4 class MyProcessingFunctionFactory(default.ProcessingFunctionFactory):
5     # 1. add the keys "chapter" and "section" to latexSpitters to handle the
6     # --config chapter and --config section options
7     latexSpitters={None: spitters.MyLatexSpitter,
8                    "section": spitters.MySectionLatexSpitter,
9                    "chapter": spitters.MyChapterLatexSpitter,
10                    }
11
12     def getLintChecker(self):
13         checker = lint.getDefaultChecker()
14         checker.allowedClasses = checker.allowedClasses.copy()
15         oldSpan = checker.allowedClasses['span']
16         checkfunc=lambda cl: oldSpan(cl) or cl in ['marketinglie',
17                                                    'productname']
18         checker.allowedClasses['span'] = checkfunc
19         return checker
20
21 factory=MyProcessingFunctionFactory()